hash: fix incorrect lookup if key is all zero