Boeing [BA] on Wednesday reported another quarter of lackluster results that included another series of charges in its defense segment, although losses in its commercial aircraft business narrowed and the company continues to expect a return to positive free cash flow this year.

The company logged about $400 million in charges in the second quarter on fixed-price development contracts in the Defense, Space & Security segment, led by a $147 hit to the MQ-25 unmanned aerial refueling aircraft on higher costs to meet certain technical requirements. In the first quarter of 2022, Boeing recorded a $78 million charge on the Navy program for additional engineering support for testing and certification.

Boeing also took a $93 million charge related to NASA’s Commercial Crew program due to launch manifest updates and additional costs associated with the uncrewed Orbital Flight Test-2 of the company’s Starliner space capsule for the agency. The capsule completed a successful flight-test in May.

The remainder of the charges were on the T-7A trainer aircraft, KC-46 aerial refueling tanker, and VC-25B presidential transport plane, none of which recorded more than about $50 million in cost growth, Brian West, Boeing’s chief financial officer, said on the company’s earnings call. He attributed the higher program costs to supply chain impacts and inflation.

In the first quarter of 2022, VC-25, T-7 and KC-46 programs were hit with $660 million, $367 million, and $165 million in charges, respectively.

West noted that the Air Force KC-46 is now certified to refuel 97 percent of the U.S. military’s air refuellable fleet.

Net income in the second quarter plummeted 72 percent to $160 million, 32 cents earnings per share (EPS), versus $567 million ($1.00 EPS) a year ago. Excluding pension adjustments, core earnings in the quarter were a 37 cents EPS loss versus 40 cents of profit a year ago, missing consensus estimates by 24 cents a share.

The company’s sales fell 2 percent to $16.7 billion from $17 billion a year ago.

Operating income in the defense segment dove 93 percent to $71 million on the charges and sales fell 10 percent to $6.2 billion.

Boeing’s bottom-line also suffered at the Commercial Airplanes segment, which posted a $242 million loss versus a $472 million loss a year ago despite a 3 percent gain in sales to $6.2 billion. Sales were up on increased deliveries of the 737-passenger jet.

Global Services, Boeing’s third operating segment, reported higher income and sales on the continued recovery in commercial services.

Free cash flow in the quarter was an outflow of $182 million and is a negative $705 million through the first half of 2022. Still, the company expects to be free cash flow positive for all of 2022 with the forecast higher in 2023, West said.

Boeing also expects sales in 2023 to be better than in 2022. The company currently doesn’t provide detailed financial guidance.

Total backlog at the end of the quarter stood at $371.7 billion, down nearly 2 percent from $377.5 billion at the end of 2021. Backlog in the defense segment stood at $55.4 billion, down 7 percent from $59.8 billion at the end of 2021.