Fix bugs in scheduling.