Improved shutdown checks