Fix a really nasty issue with output file

I'm such an idiot