Fix shutdown misbehaviour, and support health mod