Fixed hash key calculation, was causing out of bounds exceptions