patch to dht which gave incorrect results in bysample