Fix the jsonFormatString function.