Added scheduler shutdown null checks.