Bugfix on directory creation