Slightly simplify shutdon implementation.