fix bug wrt zero padding of hashes