Changed ValueError to more appropriated TypeError in hash table's hash function.