Correctly JSON-encode strings and ints