Close shells when terminating.