Keys in maps need to be sorted first by length, then lexicographically within that, ref: https://tools.ietf.org/html/rfc7049#section-3.9 If I can get a pointer on where to look to add this, i'll take a hack at it.