Improve LongHash performance.
Fix infinite loop with containsKey()