In the days and weeks after Boeing’s test flight of its new spacecraft went awry, the company and NASA went to great lengths to highlight the positives of the mission — how, as NASA Administrator Jim Bridenstine had said, “a lot of things went right.”

More than two months after the test mission was cut short by what Boeing and NASA now acknowledge were potentially catastrophic software errors, the space agency is being far more blunt about the poor performance of one of its most trusted contractors and dictating the steps Boeing must take to fix the serious problems that have been uncovered.

In a call with reporters Friday, NASA officials said an independent investigation of the marred test flight of Boeing’s Starliner spacecraft has produced 61 corrective actions and identified 49 gaps in Boeing’s testing procedures. A decision on whether Boeing will be allowed to proceed with flying astronauts or have to redo the test mission without humans on board may be months away, they said.

“We could have lost a spacecraft twice during this mission,” said Doug Loverro, NASA’s associate administrator for human exploration and mission operations. “So clearly this was a close call.”

Boeing, along with another company, SpaceX, is under contract to build a spacecraft to fly NASA’s astronauts to the International Space Station as part of the space agency’s Commercial Crew Program. NASA hasn’t had the ability to fly astronauts since the space shuttle was retired in 2011 and has faced delays and setbacks in its attempt to fly humans again from U.S. soil.

Given that lives are on the line, Loverro added: “I want to make sure everybody understands that we at NASA are talking this very seriously. … And we’re going to make sure that at the end of the day, we can fly astronauts safely on Starliner.”

The test of Boeing’s Starliner ran into trouble almost from the moment it was hoisted into space shortly before Christmas. The spacecraft’s internal clock was off by 11 hours, a significant software problem that went undiscovered because Boeing’s preflight testing was cut short and used a faulty computer simulator.

While Starliner was in flight, Boeing uncovered another software problem that should have been unearthed by testing on the ground — one that could have caused the service module to crash into the crew module before the spacecraft reentered the atmosphere.

“It’s important to remember we went into this flight … with a test plan,” said Jim Chilton, Boeing’s senior vice president for space and launch. “We had all agreed to that plan, and we executed the plan. And it wasn’t good enough.”

As a result, NASA now plans on embedding some of its software experts with Boeing’s team to oversee its work and testing more rigorously. Examples of corrective actions include fully testing all outcomes of the software instead of just the most likely ones as well as strengthening oversight of the software teams.

“We had delegated too much authority to the software board to approve changes,” Loverro said, referring to the engineering team reviewing software processes.

Meanwhile, NASA’s probe of Boeing and its processes continues, as the space agency tries to figure out when it will allow Boeing to try again.

“We’ll evaluate the results of their work,” Loverro said. “And we’ll be in a position to decide whether we need another test flight or not. We are still a ways away from that. And I can’t even tell you what the schedule is for making that decision because it’s very dependent upon what we see as Boeing’s corrective action plan.”

Chilton said Boeing has no “intent to avoid [another test flight]. We stand ready to do it.”

A repeat of the test would come at an enormous cost for a program that already is unusually rigid and governed by a “firmed fixed-price cost” contract. In case it does have to repeat the test, Boeing has taken a $410 million charge, it said during its most recent earnings call.

Boeing has been under enormous financial strain since the grounding of its 737 Max airplane fleet after two fatal crashes killed a total of 346 people. Both the Max and Starliner failures were tied to software problems, and Chilton said Friday that the issues discovered during the Starliner investigation have been shared with the commercial airplane division.

“Certainly we have what we consider a strong, and in fact we are strengthening our central and core engineering organizations both around software and other things,” he said. “These learnings have been fed to those teams and I know are being applied across our enterprise. I’m not aware of anything common or relevant to the 737 Max out of this.”

The call with NASA came as House investigators Friday released a damning report concluding that the mistakes on the 737 Max were a result of “technical design failures, lack of transparency with both regulators and customers and efforts to obfuscate information about the operation of the aircraft.”