Fixed #23627 -- Allowed register_lookup to work as a decorator.