Fixed some bugs with the schedule class