Fix a file creation bug