Fix bug where the recorder would write output files twice