Fixed bug in output to file