New York CNN Business —  

The Dow ended Thursday slightly lower, dragged down by a poorly performing Boeing (BA).

Boeing’s stock closed 2.9% lower, making it the worst performer in the Dow. The plane manufacturer has been struggling with the crisis surrounding its top-selling 737 Max airplane.

The aircraft, which was involved in two recent deadly crashes and has since been grounded around the world, received an updated computer system. But a new flaw has been discovered while the new system was tested in simulator flights, CNN reported earlier Thursday.

Gains in Walgreens Boots Alliance (WBA) stock help offset the Boeing losses.

The Dow (INDU) flipped between the positive and negative territory all day. It closed little changed but in the red, down 10 points.

Elsewhere, stocks trended higher across the board ahead of the G20 summit in Japan.

The S&P 500 (SPX) and the Nasdaq Composite (COMP) closed in the green, up 0.4% and 0.7%, respectively.

Friday is the last trading day of the month, the quarter and the first half of the year. Stocks are on pace to record their best month since January.

Counting down to Trump meetings at the G20 summit

Aside from Boeing, the G20 meeting is front and center of investors’ minds.

The summit is kicking off Friday in Japan.

President Donald Trump has arrived in Japan for the summit at which he will meet multiple leaders on the sidelines to talk trade. Most importantly, investors are awaiting Trump’s meeting with China’s President Xi Jinping.

China insists that the United States would cancel its ban on Chinese tech firm Huawei as part of a trade agreement, according to The Wall Street Journal. In May, Trump ordered US companies to refrain from using technology from any foreign firms deemed a national security threat, which was viewed as a ban on Huawei specifically.

White House economic adviser Larry Kudlow rebuked the story in an interview with Fox News, saying “there are no preconditions” to get a trade deal done.

Earlier Thursday, Trump said he would also meet with India’s Prime Minister Narendra Modi in a tweet. India ramped up tariffs on US imports last week. Trump said this was “unacceptable and the tariffs must be withdrawn,” in his tweet.

A positive outcome from the Trump-Xi meeting could spark a rally in riskier assets, like stocks, and boost hopes that the end of the trade spat is in sight. On the flipside, further escalation with additional tariffs waiting in the wings could weigh on stocks and drive safe haven investments like gold and US treasuries higher.