hash: fix lookup_hash semantics