Finally fix the scheduler.