Index: uspace/lib/libc/generic/async.c
===================================================================
--- uspace/lib/libc/generic/async.c	(revision 5b5d25f252b73fa4ce4c6c4adcc81962ee05905e)
+++ uspace/lib/libc/generic/async.c	(revision 116d3f6f655456c410fc698142213ee6eceee904)
@@ -363,5 +363,5 @@
 		 * case, route_call() will perform the wakeup.
 		 */
-		fibril_schedule_next_adv(FIBRIL_TO_MANAGER);
+		fibril_switch(FIBRIL_TO_MANAGER);
 		/*
 		 * Futex is up after getting back from async_manager get it
@@ -585,5 +585,5 @@
 
 	while (1) {
-		if (fibril_schedule_next_adv(FIBRIL_FROM_MANAGER)) {
+		if (fibril_switch(FIBRIL_FROM_MANAGER)) {
 			futex_up(&async_futex); 
 			/*
@@ -804,6 +804,6 @@
 	msg->wdata.inlist = 0;
 	/* Leave the async_futex locked when entering this function */
-	fibril_schedule_next_adv(FIBRIL_TO_MANAGER);
-	/* futex is up automatically after fibril_schedule_next...*/
+	fibril_switch(FIBRIL_TO_MANAGER);
+	/* futex is up automatically after fibril_switch...*/
 done:
 	if (retval)
@@ -843,6 +843,6 @@
 
 	/* Leave the async_futex locked when entering this function */
-	fibril_schedule_next_adv(FIBRIL_TO_MANAGER);
-	/* futex is up automatically after fibril_schedule_next...*/
+	fibril_switch(FIBRIL_TO_MANAGER);
+	/* futex is up automatically after fibril_switch...*/
 
 	if (!msg->done)
@@ -885,6 +885,6 @@
 	insert_timeout(&msg->wdata);
 	/* Leave the async_futex locked when entering this function */
-	fibril_schedule_next_adv(FIBRIL_TO_MANAGER);
-	/* futex is up automatically after fibril_schedule_next_adv()...*/
+	fibril_switch(FIBRIL_TO_MANAGER);
+	/* futex is up automatically after fibril_switch()...*/
 	free(msg);
 }
Index: uspace/lib/libc/generic/fibril.c
===================================================================
--- uspace/lib/libc/generic/fibril.c	(revision 5b5d25f252b73fa4ce4c6c4adcc81962ee05905e)
+++ uspace/lib/libc/generic/fibril.c	(revision 116d3f6f655456c410fc698142213ee6eceee904)
@@ -76,5 +76,5 @@
 		return NULL;
 
-	f = malloc(sizeof(*f));
+	f = malloc(sizeof(fibril_t));
 	if (!f) {
 		__free_tls(tcb);
@@ -85,4 +85,11 @@
 	f->tcb = tcb;
 
+	f->func = NULL;
+	f->arg = NULL;
+	f->stack = NULL;
+	f->clean_after_me = NULL;
+	f->retval = 0;
+	f->flags = 0;
+
 	return f;
 }
@@ -107,9 +114,9 @@
 	f->retval = f->func(f->arg);
 
-	fibril_schedule_next_adv(FIBRIL_FROM_DEAD);
+	fibril_switch(FIBRIL_FROM_DEAD);
 	/* not reached */
 }
 
-/** Schedule next fibril.
+/** Switch from the current fibril.
  *
  * If calling with FIBRIL_TO_MANAGER parameter, the async_futex should be
@@ -122,5 +129,5 @@
  * 			return 1 otherwise.
  */
-int fibril_schedule_next_adv(fibril_switch_type_t stype)
+int fibril_switch(fibril_switch_type_t stype)
 {
 	fibril_t *srcf, *dstf;
@@ -139,6 +146,6 @@
 		 * managers.
 		 */
-		if (list_empty(&serialized_list) && fibrils_in_manager <=
-		    serialized_fibrils) {
+		if (list_empty(&serialized_list) &&
+		    fibrils_in_manager <= serialized_fibrils) {
 			goto ret_0;
 		}
@@ -164,5 +171,16 @@
 				 * restored context here.
 				 */
-				free(srcf->clean_after_me->stack);
+				void *stack = srcf->clean_after_me->stack; 
+				if (stack) {
+					/*
+					 * This check is necessary because a
+					 * thread could have exited like a
+					 * normal fibril using the
+					 * FIBRIL_FROM_DEAD switch type. In that
+					 * case, its fibril will not have the
+					 * stack member filled.
+					 */
+					free(stack);
+				}
 				fibril_teardown(srcf->clean_after_me);
 				srcf->clean_after_me = NULL;
@@ -185,5 +203,5 @@
 		}
 	}
-
+	
 	/* Choose a new fibril to run */
 	if (stype == FIBRIL_TO_MANAGER || stype == FIBRIL_FROM_DEAD) {
@@ -195,5 +213,5 @@
 		fibrils_in_manager++;
 
-		if (stype == FIBRIL_FROM_DEAD)
+		if (stype == FIBRIL_FROM_DEAD) 
 			dstf->clean_after_me = srcf;
 	} else {
@@ -234,15 +252,11 @@
 	f->stack = (char *) malloc(FIBRIL_INITIAL_STACK_PAGES_NO *
 	    getpagesize());
-
 	if (!f->stack) {
 		fibril_teardown(f);
 		return 0;
 	}
-
+	
+	f->func = func;
 	f->arg = arg;
-	f->func = func;
-	f->clean_after_me = NULL;
-	f->retval = 0;
-	f->flags = 0;
 
 	context_save(&f->ctx);
Index: uspace/lib/libc/generic/ipc.c
===================================================================
--- uspace/lib/libc/generic/ipc.c	(revision 5b5d25f252b73fa4ce4c6c4adcc81962ee05905e)
+++ uspace/lib/libc/generic/ipc.c	(revision 116d3f6f655456c410fc698142213ee6eceee904)
@@ -220,5 +220,5 @@
 		if (can_preempt) {
 			call->fid = fibril_get_id();
-			fibril_schedule_next_adv(FIBRIL_TO_MANAGER);
+			fibril_switch(FIBRIL_TO_MANAGER);
 			/* Async futex unlocked by previous call */
 		} else {
Index: uspace/lib/libc/generic/thread.c
===================================================================
--- uspace/lib/libc/generic/thread.c	(revision 5b5d25f252b73fa4ce4c6c4adcc81962ee05905e)
+++ uspace/lib/libc/generic/thread.c	(revision 116d3f6f655456c410fc698142213ee6eceee904)
@@ -105,5 +105,5 @@
 	f = fibril_setup();
 	__tcb_set(f->tcb);
-	
+
 	uarg->uspace_thread_function(uarg->uspace_thread_arg);
 	/* XXX: we cannot free the userspace stack while running on it */
Index: uspace/lib/libc/include/async.h
===================================================================
--- uspace/lib/libc/include/async.h	(revision 5b5d25f252b73fa4ce4c6c4adcc81962ee05905e)
+++ uspace/lib/libc/include/async.h	(revision 116d3f6f655456c410fc698142213ee6eceee904)
@@ -46,5 +46,5 @@
 static inline void async_manager(void)
 {
-	fibril_schedule_next_adv(FIBRIL_TO_MANAGER);
+	fibril_switch(FIBRIL_TO_MANAGER);
 }
 
Index: uspace/lib/libc/include/fibril.h
===================================================================
--- uspace/lib/libc/include/fibril.h	(revision 5b5d25f252b73fa4ce4c6c4adcc81962ee05905e)
+++ uspace/lib/libc/include/fibril.h	(revision 116d3f6f655456c410fc698142213ee6eceee904)
@@ -78,5 +78,5 @@
 extern fibril_t *fibril_setup(void);
 extern void fibril_teardown(fibril_t *f);
-extern int fibril_schedule_next_adv(fibril_switch_type_t stype);
+extern int fibril_switch(fibril_switch_type_t stype);
 extern void fibril_add_ready(fid_t fid);
 extern void fibril_add_manager(fid_t fid);
@@ -86,6 +86,6 @@
 extern void fibril_dec_sercount(void);
 
-static inline int fibril_schedule_next(void) {
-	return fibril_schedule_next_adv(FIBRIL_PREEMPT);
+static inline int fibril_yield(void) {
+	return fibril_switch(FIBRIL_PREEMPT);
 }
 
Index: uspace/srv/fs/fat/fat.c
===================================================================
--- uspace/srv/fs/fat/fat.c	(revision 5b5d25f252b73fa4ce4c6c4adcc81962ee05905e)
+++ uspace/srv/fs/fat/fat.c	(revision 116d3f6f655456c410fc698142213ee6eceee904)
@@ -183,14 +183,6 @@
 	async_set_client_connection(fat_connection);
 
-	async_create_manager();
-
-	/*
-	 * TODO: Interestingly, if we merely return, the only thread dies.
-	 *	 If the only thread dies, the whole task is destroyed. 
-	 *	 Prevent the thread from exiting when there are active fibrils.
-	 */
-	fibril_schedule_next_adv(FIBRIL_FROM_DEAD);
+	async_manager();
 	/* not reached */
-
 	return 0;
 }
