Fixed memory leak with JSON objects