Fix bad hash implementation