Make ungraceful shutdowns slightly more graceful.