Sync fixes applied to a large degree, prepare to merge back.