Handle more shutdown cases.