Added an exit code to the rename function.