Fixing some of the sync bugs