fix minor bug in WriteToFile parameter.