run.rb: add procedures to rename final output.