BUGFIX: NULL pointer dereference at module unload