Improve output file name change.