GitHub #137: More work on shutdown