JSon and MsgPack encoding fixes.