Fix hashing function bug.

In last version, the tag which used as bucket index maybe exceed the
capacity of bucket table. I fix the cuckoo hashing function to limit the
tag value.