Minor fix in JSON encoding