Index: uspace/srv/fs/fat/fat_fat.c
===================================================================
--- uspace/srv/fs/fat/fat_fat.c	(revision 75a2dc0891a715f17bfc4b0f7437ea9fcbb9dd64)
+++ uspace/srv/fs/fat/fat_fat.c	(revision fd210dec339fbd65e3f75d03def7b1614785a1b6)
@@ -451,4 +451,21 @@
 }
 
+void
+fat_zero_cluster(struct fat_bs *bs, dev_handle_t dev_handle, fat_cluster_t c)
+{
+	int i;
+	block_t *b;
+	unsigned bps;
+
+	bps = uint16_t_le2host(bs->bps);
+	
+	for (i = 0; i < bs->spc; i++) {
+		b = _fat_block_get(bs, dev_handle, c, i, BLOCK_FLAGS_NOREAD);
+		memset(b->data, 0, bps);
+		b->dirty = true;
+		block_put(b);
+	}
+}
+
 /**
  * @}
Index: uspace/srv/fs/fat/fat_fat.h
===================================================================
--- uspace/srv/fs/fat/fat_fat.h	(revision 75a2dc0891a715f17bfc4b0f7437ea9fcbb9dd64)
+++ uspace/srv/fs/fat/fat_fat.h	(revision fd210dec339fbd65e3f75d03def7b1614785a1b6)
@@ -84,4 +84,5 @@
 extern void fat_fill_gap(struct fat_bs *, struct fat_node *, fat_cluster_t,
     off_t);
+extern void fat_zero_cluster(struct fat_bs *, dev_handle_t, fat_cluster_t);
 
 #endif
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision 75a2dc0891a715f17bfc4b0f7437ea9fcbb9dd64)
+++ uspace/srv/fs/fat/fat_ops.c	(revision fd210dec339fbd65e3f75d03def7b1614785a1b6)
@@ -332,18 +332,6 @@
 	/* idxp->lock held */
 	if (flags & L_DIRECTORY) {
-		int i;
-		block_t *b;
-
-		/*
-		 * Populate the new cluster with unused dentries.
-		 */
-		for (i = 0; i < bs->spc; i++) {
-			b = _fat_block_get(bs, dev_handle, mcl, i,
-			    BLOCK_FLAGS_NOREAD);
-			/* mark all dentries as never-used */
-			memset(b->data, 0, bps);
-			b->dirty = false;
-			block_put(b);
-		}
+		/* Populate the new cluster with unused dentries. */
+		fat_zero_cluster(bs, dev_handle, mcl);
 		nodep->type = FAT_DIRECTORY;
 		nodep->firstc = mcl;
@@ -462,5 +450,5 @@
 	 * We need to grow the parent in order to create a new unused dentry.
 	 */
-	if (parentp->idx->pfc == FAT_CLST_ROOT) {
+	if (parentp->firstc == FAT_CLST_ROOT) {
 		/* Can't grow the root directory. */
 		fibril_mutex_unlock(&parentp->idx->lock);
@@ -472,12 +460,10 @@
 		return rc;
 	}
+	fat_zero_cluster(bs, parentp->idx->dev_handle, mcl);
 	fat_append_clusters(bs, parentp, mcl);
-	b = fat_block_get(bs, parentp, i, BLOCK_FLAGS_NOREAD);
+	parentp->size += bps * bs->spc;
+	parentp->dirty = true;		/* need to sync node */
+	b = fat_block_get(bs, parentp, i, BLOCK_FLAGS_NONE);
 	d = (fat_dentry_t *)b->data;
-	/*
-	 * Clear all dentries in the block except for the first one (the first
-	 * dentry will be cleared in the next step).
-	 */
-	memset(d + 1, 0, bps - sizeof(fat_dentry_t));
 
 hit:
Index: uspace/srv/ns/task.h
===================================================================
--- uspace/srv/ns/task.h	(revision 75a2dc0891a715f17bfc4b0f7437ea9fcbb9dd64)
+++ uspace/srv/ns/task.h	(revision fd210dec339fbd65e3f75d03def7b1614785a1b6)
@@ -35,10 +35,8 @@
 
 #include <ipc/ipc.h>
-#include <event.h>
 
 extern int task_init(void);
 extern void process_pending_wait(void);
 
-extern void wait_notification(wait_type_t et, task_id_t id);
 extern void wait_for_task(task_id_t id, ipc_call_t *call, ipc_callid_t callid);
 
Index: uspace/srv/vfs/vfs_node.c
===================================================================
--- uspace/srv/vfs/vfs_node.c	(revision 75a2dc0891a715f17bfc4b0f7437ea9fcbb9dd64)
+++ uspace/srv/vfs/vfs_node.c	(revision fd210dec339fbd65e3f75d03def7b1614785a1b6)
@@ -188,5 +188,5 @@
 	}
 
-	assert(node->size == result->size);
+	assert(node->size == result->size || node->type != VFS_NODE_FILE);
 	assert(node->lnkcnt == result->lnkcnt);
 	assert(node->type == result->type || result->type == VFS_NODE_UNKNOWN);
