Boeing [BA] on Wednesday reported big drops in sales and earnings in its third quarter as it continues to struggle with the grounding of its 737 MAX passenger plane, which it expects to return to service later this year.

The safe return to service of the 737 MAX, which suffered two tragic crashes in the past year, remains the company’s top priority, Dennis Muilenburg, Boeing’s president and CEO, said on the company’s earnings call.

The earnings call was dominated by discussion of the 737 MAX and other commercial programs, including the 787 Dreamliner widebody aircraft, for which Boeing plans to trim monthly production for two years from 14 to 12 aircraft beginning in late 2020. The production cut is due to lower than expected orders from customers in China the last two years because of trade tensions between the U.S. and China.

Net income in the quarter fell 51 percent to $1.2 billion, $2.05 earnings per share (EPS), from $2.4 billion ($4.07 EPS) a year ago. Core earnings, which excludes pension cost adjustments, were $1.45 EPS versus consensus estimates of $2.07 EPS.

Sales slid 21 percent to $20 billion from $25.1 billion a year ago.

The top and bottom lines were weighed down by Boeing’s Commercial Airplanes segment due to a steep drop in aircraft deliveries, 62 versus 190 a year ago, and an estimated $900 million increase in 737 MAX costs related to the timing of return to service and planned production rate increases.

Boeing on Tuesday announced a leadership change for Commercial Airplanes, naming Stan Deal as its new president and CEO, taking over for Kevin McAllister, who had the helm for three years. Deal previously led the Global Services segment, which is now led by Ted Colbert, who previously was chief information officer and senior vice president of Information Technology & Data Analytics at the company.

Boeing’s defense segment swung to a $755 million operating profit versus a $247 million loss a year ago when it took charges of $691 million related to planned investments in two marquis programs it had just won–the Air Force T-X trainer and Navy MQ-25 unmanned aerial refueling tanker–and a $64 million charge related to cost growth on the Air Force KC-46 tanker program. Segment operating margin was 10.7 percent.

Defense segment sales were up 2 percent to just over $7 billion on satellites, weapons, the T-X, which has been renamed the T-7A Red Hawk, and other franchise programs the company won last year. The segment won $5 billion in contract awards during the quarter.

There are $2.5 trillion in opportunities in the defense and space market over the next decade for Boeing to pursue, with 40 percent of the potential business from international customers, Muilenburg said.

The segment’s backlog at the end of the quarter stood at $61.7 billion, up 8 percent from $61.3 billion at the end of 2018. International customers account for 30 percent of the backlog.

Sales in the Global Services segment were up 14 percent on an acquisition last October and government business while operating income was also up handsomely on improved performance.

Boeing’s overall backlog at the end of the quarter stood at $470.2 billion, down 4 percent from $490.5 billion at the end of 2018 due solely to a decline at Commercial Airplanes. Free cash was a $2.9 billion outflow in the quarter.

Muilenburg also provided an update on plans to create two joint ventures with Brazilian aircraft manufacturer Embraer [ERJ], with the deals now expected to close in early 2020 instead of late 2019. Boeing will take an 80 percent stake in the commercial aircraft venture and a 49 percent stake in the KC-390 multi-mission medium-lift aircraft partnership.

U.S. and Japanese regulators have already approved the teaming with Embraer. The European Commission is still assessing the deal.