Fix bug in updating schedules.