Get rid of crashes in shutdown.