Fixes to ddb encoding for hashes.