Added checks for invalid characters for JSONP