Fixed bug when restoring directories at the end of a manifest.