Worked on the pygtk backend: fixed write_to_file()