Fixed bugs in schedule