fix JSON well-formedness problems