Tweak to calculate hashes correctly