Changed hash function to cast to unsigned first