Fix write file.