Fix key bug, and add test for el-stupido Json encoding bug