Boeing reported a better-than-expected first-quarter profit even as it scrambled to fix its grounded 787.

The company said on Wednesday that deliveries of the 787 should resume in early May. Most of the 50 planes that have been delivered to airlines will be fixed by the middle of the month, Chairman and CEO Jim McNerney said on the company’s quarterly earnings conference call.

Resuming deliveries and passenger flights would cap a notable turnaround for Boeing.

The three-month grounding over battery problems frustrated airlines and turned a spotlight onto the way commercial planes are designed and regulated.

Putting the problem behind it will let Boeing focus on building new versions of its best-selling 737 and 777.

Air safety authorities around the world grounded 787s after two planes suffered from smoldering batteries — one of them including a fire, one of them in-flight — in January. The Federal Aviation Administration has approved Boeing’s redesigned battery system, which the company says should sharply reduce the risk of a fire.

Once the FAA approves the fix on individual planes, airlines can start flying them again. United Airlines, the only U.S. airline with the planes, moved one of its six 787s to a Boeing facility in San Antonio, Texas, on Tuesday so it can get the battery fix.

Neither of the battery incidents involved a United jet.

The new battery system includes extra insulation between the battery’s individual cells, a box designed to contain any fire and changes that Boeing says will extinguish any fire almost instantly.

The fix should keep any battery problems “from affecting the airplane or even being noticed by passengers,” McNerney said.

Boeing wouldn’t say how much the 787 issue has cost.

Much of the expense was soaked up by its research and development budget, Chief Financial Officer Greg Smith said.

Boeing’s net income rose 20 percent in the quarter to $1.11 billion, or $1.44 per share. Excluding pension-related charges, Boeing would have earned $1.73 per share, well above analyst expectations.