Fixed an output file bug