More tweaks to sync.py