Scheduler bugfixes