Fix fatal error on plugin deactivation