Fix unit tests and copy_and_rename invocation.