Fix incorrect output with simple case of single output file