Fix copy_remote_file_to_nodes to really write remotely