Fix an invalid reference when registration is disabled