Sync fixes

Fix a few sync related bugs... see individual commit messages for details