Sync error catching

Fix some more problems with sync