bugfixes for directory creation