Fix TypeError in hashing_helper