Use common hash instead of LongSparseArray
Couple of minor fixes