Make sync work, at least the basic cases.