fixed hash table routine giving up prematurely on search / insertion in some cases