Fixed for loop break in schedule.c