Try to handle shutdown failures more gracefully