Fixed file renaming when copying target-to-device