Fix directory creation bug.