Bug fixes in data sync.