Corrected JSON encoding errors