reglookup: Move patching to the prepare function.