As expected, Boeing [BA] on Wednesday announced dismal fourth quarter financial results due to massive charges and additional costs related to the 737 MAX commercial aircraft, leading to losses in the quarter and for 2019, and the company’s defense and services segments also fared poorly with lower sales and various charges.

Boeing swung to a $1 billion loss, negative $1.79 for earnings per share (EPS), in the quarter from $3.4 billion ($5.93 EPS) in net income a year ago, largely due to a $2.6 billion pre-tax charge related to potential concessions and other considerations to customers for the grounding of the 737 MAX, which isn’t expected to return to service until mid-2020. The 737 program was also hit with $2.6 billion in additional costs to reflect updated production and delivery assumptions.

Core earnings in the quarter also swung to a loss, negative $2.33 EPS versus $5.48 a year ago, missing consensus estimates by 50 cents per share.

But Boeing also suffered from additional charges, including a $410 million pre-tax hit to its Defense, Space & Security segment stemming from the failure in December of its CST-100 Starliner space capsule to reach proper orbit after launch. The Global Services segment was also pinched due to a charge to retire the Aviall brand and mix of products and services for commercial airlines.

The reserve for NASA’s Starliner is based on the potential for an additional uncrewed launch of the space transportation system. The space agency will determine if another uncrewed mission is necessary. The reusable Starliner is being developed to carry crews to the International Space Station.

Boeing’s Defense, Space & Security segment posted a 13 percent decline in sales to $6 billion on lower volume across the portfolio and also due to revenue impacts from the Starliner charge. Operating income dove 96 percent to $31 million, mainly due to the charge, but also on performance issues and product mix that favored lower margin sales.

For 2019, the defense business increased operating income 57 percent to $2.6 billion despite a 1 percent dip in sales to $26.2 billion.

Boeing’s Global Services segment, which provides a range of services to commercial and defense customers, posted mid-single digit declines in sales and operating income in the quarter, mainly due to lower commercial services volume. Profits declined largely on the charge related to the rebranding of the Aviall products and services under the Boeing brand.

The heaviest weight on Boeing’s fourth quarter came from its Commercial Airplanes segment, which saw sales plummet 55 percent to $7.5 billion on decline in 737 deliveries and the MAX charge. The operating loss was $2.8 billion.

In addition to the $5.2 billion in charges and additional production costs that hammered Boeing Commercial Airplanes in the quarter, the company said it expects an additional $4 billion of “abnormal production costs that will be expensed as incurred, primarily in 2020” as the company slowly ramps up production again on the MAX.

David Calhoun, Boeing’s new President and CEO, said at the outset of the company’s earnings call that his first priority is returning the MAX to service “safely.”

Last year, following a second fatal crash of the aircraft, airlines and regulators globally grounded the fleet of 737 MAX aircraft.

Calhoun also outlined five additional priorities: rebuilding Boeing’s trust with all of its constituencies, focusing on its values, including doing a better job listening to its employees, operate with excellence by getting back to basics across the enterprise to deliver safe products while improving quality, restore production health in the company and the supply chain, and invest in the future to meet the evolving demands of customers and growth in all of its markets.

Overall in 2019, the net loss was $636 million, negative $1.12 EPS, versus $10.5 billion ($17.85 EPS) a year ago. Core earnings swung to a $3.47 EPS loss.

Free cash flow in the quarter was a negative $2.7 billion and for the year was negative $4.3 billion.

Boeing’s backlog at the end of 2019 stood at $463.4 billion, down 6 percent from $490.5 billion at the end of 2018, due solely to declines at Commercial Airplanes. Backlog at the defense business was up 4 percent to $63.9 billion from a year ago.