Fixed a problem where output file wasn't taken into account when set