Shutdown functions updated