Added the missing connection checking to the dataset sync.
Also added some TODO comments.