hash: fix leak
hash: fix leak, and speed things up