Fix shutdown.