Fixing a bug with shutdown-on-idle code that I introduced