Code cleanups
Sync fixes