Fix JSON handling of embedded quotes and backslashes