Bunch of code fixes for when you have a reference file + single output file