Fixed bug with creating the output file during testing