Several bugfixes and speed improvements related to the delayed storing of directories.