Clean Shutdown

Just some tweaks and better specs around shutting down gracefully.