v3 proto: error tweaks and test cleanups
v3 proto: reorganized lookup_hash code