Don't throw an Exception while shutting down, close #2334