More fixes for scheduler