Index: Directory.java
===================================================================
--- Directory.java	(revision 1724)
+++ Directory.java	(working copy)
@@ -152,12 +152,13 @@
 		long dirPosition = chan.position();
 		int blockSize = headerBlockManager.getBlockSize();
 
-		int forHeader = (blocks + (blockSize - 1)) / blockSize;
+		//wrong formula int forHeader = (blocks + (blockSize - 1)) / blockSize;
+		int forHeader = (blocks + DirectoryEntry.SLOTS_PER_ENTRY - 1)/DirectoryEntry.SLOTS_PER_ENTRY;
 		log.debug("header blocks needed", forHeader);
 
 		// There is nothing really wrong with larger values (perhaps, I don't
 		// know for sure!) but the code is written to make it 1, so make sure that it is.
-		assert forHeader == 1;
+		//assert forHeader == 1;
 
 		// Write the blocks that will will contain the header blocks.
 		chan.position(dirPosition + (long) forHeader * Dirent.ENTRY_SIZE);
