- Fix a bug in file writer