A few registry and server shutdown related fixups and improvements.