Changed int casting when adding schedule.