trie: fixed more kv encode/decode issues.