Attempt to make shutdowns more cleaner.