Fix broken shutdown.