Add sync to local script.
Better file names and fix errors in localcopy.