Fix event emitting in CGI parser.