General Electric raised its 2019 forecast on Wednesday, helped by improvement in its industrial businesses, even as its latest earnings dipped into the red after two profitable quarters, sending shares up 3 percent in premarket trading.

GE swung back to a financial loss in the second quarter as the cost of restructuring its ailing power business and the grounding of a Boeing jetliner drained more cash than expected from GE’s otherwise profitable industrial units.

The Boston-based maker of jet engines, power plants and medical devices also said chief financial officer Jamie Miller was stepping down but would stay on until a successor is hired.

The loss resulted from a $744 million goodwill impairment charge that GE said was related to moving a power grid software business to its digital unit.

GE’s power business, which has long been a drag on earnings, posted a $117 million profit. But its relatively strong aviation business suffered as problems stretched on with Boeing’s 737 MAX jetliner, which regulators grounded in March.

GE, which makes the jet’s engines through a joint venture, said it saw a $600 million cash outflow in the quarter due to the grounding, and it expects to take a hit of $400 million per quarter in the second half if the grounding continues.

Boeing said last week it might halt production of the jet, depending on how long it takes aviation regulators to determine if it is safe to fly after two crashes within five months killed 346 people.

GE’s adjusted industrial free cash flow in the quarter was negative $1 billion, at the better end of the range of negative $1 billion to $2 billion that chief executive officer Larry Culp indicated in May.

GE shares were up about 4 percent at $10.95 in premarket trading.

“Free cash flow is the metric everyone cares about,” said Deane Dray, an analyst at RBC Capital Markets.

Investors had been watching with alarm as GE’s cash generation failed to keep pace with earnings in recent years, raising concerns that GE’s actual financial performance was falling short of stated results. GE had been known to manage earnings, but Culp said in May he would focus on generating cash and let earnings be “almost like a byproduct,” Dray said.

Yet despite posting a loss, GE raised its full-year forecasts. It now expects industrial organic revenue growth to make a “mid-single-digits” percentage increase, up from GE’s earlier forecast of “low-to-mid single digits.”

It also lifted the range of adjusted earnings per share by 5 cents to between 55 cents and 65 cents, and shifted its forecast for industrial free cash flow to between negative $1 billion and positive $1 billion, from $0 to negative $2 billion.

GE’s loss from continuing operations attributable to shareholders was $291 million in the quarter ended June 30, compared to a profit of $679 million a year earlier.

Loss per share from continuing operations was 3 cents down from a profit of 8 cents, the company said. On an adjusted basis, GE earned 17 cents per share, including a one-time tax audit gain of 6 cents. That compared with analysts’ estimates of 12 cents, on average, according to IBES data from Refinitiv.

Total revenue fell 1.1% to $28.8 billion.