Fix shutdown.
Add another assertion.