Mark,
Seen in a report by fsck_hfs:
**Checking Catalog hierarchy. Invalid directory item count (It should be 8 instead of 393216)
My code had indeed forgotten to register two files, but the message forgets to swap the value (393216 == 6 in bigendian, or the other way around).