Tidying up the scheduler.