Added check for output files before attempting move.