Better output-file renaming