Fix three scheduler bugs.