Index: uspace/lib/ext4/libext4_balloc.c
===================================================================
--- uspace/lib/ext4/libext4_balloc.c	(revision 41998ec18171bdb3f8e12bb918218cc0160b90ae)
+++ uspace/lib/ext4/libext4_balloc.c	(revision 412f8139722cfac64f440764adbbca53d198299b)
@@ -242,5 +242,6 @@
 }
 
-int ext4_balloc_alloc_block(ext4_filesystem_t *fs, ext4_inode_ref_t *inode_ref, uint32_t *fblock)
+int ext4_balloc_alloc_block(ext4_filesystem_t *fs,
+		ext4_inode_ref_t *inode_ref, uint32_t *fblock)
 {
 	int rc;
@@ -462,4 +463,5 @@
 
 	// Update inode blocks (different block size!) count
+
 	uint64_t ino_blocks = ext4_inode_get_blocks_count(fs->superblock, inode_ref->inode);
 	ino_blocks += block_size / EXT4_INODE_BLOCK_SIZE;
Index: uspace/lib/ext4/libext4_directory_index.c
===================================================================
--- uspace/lib/ext4/libext4_directory_index.c	(revision 41998ec18171bdb3f8e12bb918218cc0160b90ae)
+++ uspace/lib/ext4/libext4_directory_index.c	(revision 412f8139722cfac64f440764adbbca53d198299b)
@@ -510,25 +510,29 @@
 
 	while ((void *)dentry < old_data_block->data + block_size) {
-		char *name = (char *)dentry->name;
-
-		uint8_t len = ext4_directory_entry_ll_get_name_length(fs->superblock, dentry);
-		ext4_hash_string(&tmp_hinfo, len, name);
-
-		uint32_t rec_len = 8 + len;
-
-		if ((rec_len % 4) != 0) {
-			rec_len += 4 - (rec_len % 4);
-		}
-
-		memcpy(entry_buffer_ptr, dentry, rec_len);
-
-		sort_array[idx].dentry = entry_buffer_ptr;
-		sort_array[idx].rec_len = rec_len;
-		sort_array[idx].hash = tmp_hinfo.hash;
-
-		entry_buffer_ptr += rec_len;
-		real_size += rec_len;
-
-		idx++;
+
+		// Read only valid entries
+		if (ext4_directory_entry_ll_get_inode(dentry) != 0) {
+			char *name = (char *)dentry->name;
+
+			uint8_t len = ext4_directory_entry_ll_get_name_length(fs->superblock, dentry);
+			ext4_hash_string(&tmp_hinfo, len, name);
+
+			uint32_t rec_len = 8 + len;
+
+			if ((rec_len % 4) != 0) {
+				rec_len += 4 - (rec_len % 4);
+			}
+
+			memcpy(entry_buffer_ptr, dentry, rec_len);
+
+			sort_array[idx].dentry = entry_buffer_ptr;
+			sort_array[idx].rec_len = rec_len;
+			sort_array[idx].hash = tmp_hinfo.hash;
+
+			entry_buffer_ptr += rec_len;
+			real_size += rec_len;
+			idx++;
+		}
+
 		dentry = (void *)dentry + ext4_directory_entry_ll_get_entry_length(dentry);
 	}
@@ -571,4 +575,9 @@
 	}
 
+	uint32_t continued = 0;
+	if (new_hash == sort_array[mid-1].hash) {
+		continued = 1;
+	}
+
 	uint32_t offset = 0;
 	void *ptr;
@@ -624,5 +633,5 @@
 
 	ext4_directory_dx_entry_set_block(new_index_entry, new_iblock);
-	ext4_directory_dx_entry_set_hash(new_index_entry, new_hash);
+	ext4_directory_dx_entry_set_hash(new_index_entry, new_hash + continued);
 
 	ext4_directory_dx_countlimit_set_count(countlimit, count + 1);
@@ -844,11 +853,20 @@
 success:
 
-	block_put(target_block);
-	block_put(new_block);
+	rc = block_put(target_block);
+	if (rc != EOK) {
+		EXT4FS_DBG("error writing target block");
+	}
+	rc = block_put(new_block);
+	if (rc != EOK) {
+		EXT4FS_DBG("error writing new block");
+	}
 
 	ext4_directory_dx_block_t *dx_it = dx_blocks;
 
 	while (dx_it <= dx_block) {
-		block_put(dx_it->block);
+		rc = block_put(dx_it->block);
+		if (rc != EOK) {
+			EXT4FS_DBG("error writing index block \%u", (uint32_t)dx_it->block->pba);
+		}
 		dx_it++;
 	}
