Fix an error (i instead of j) that caused a JSONException