Bug fixes in time sync