Fixed to_file to meet coding standards #495