Fix crash condition in scheduler (take 2)