Fixed broken hash function