Misc fixes
Shutdown fix