* Fixed a potential crash in shutdown() code