Fix file and directory creation