Modified error checking when changing scheduler in engine.