fix various syncing bugs