Added malformed JSON handling