Support for remote cmd. Bugs corrected.

Bug on file copy error.