fix bugs in `cp` command when target and destination are the same node (and the target/destination is a proxy)