Fix problems with sync command