A U.S. judge on Wednesday said Fiat Chrysler Automobiles NV must face a lawsuit claiming it defrauded shareholders by overstating its ability to comply with vehicle safety laws.

U.S. District Judge Jesse Furman in Manhattan said the automaker must face claims over statements in late 2014 that it was “substantially” in compliance, even as it was being probed by the National Highway Traffic and Safety Administration for shortcomings tied to two recalls.

Furman dismissed claims accusing Fiat Chrysler of violating accounting principles by failing to set aside enough money to cover recalls it had reason to expect.

The judge also allowed shareholders to pursue claims over the compliance disclosures against Chief Executive Sergio Marchionne and the former safety chief of the automaker’s FCA U.S. unit, Scott Kunselman.

Fiat Chrysler, in a statement, said it was pleased that the judge dismissed “several of the more significant claims,” and that it will defend itself against the surviving claims.

Lawyers for the shareholders did not immediately respond to similar requests.

The shareholders accused the defendants of inflating Fiat Chrysler’s share price by hundreds of millions of dollars from October 2014 and October 2015 by downplaying safety concerns.

They said the shortcomings materialized last year when the automaker paid $175 million of NHTSA fines, and took a roughly $670 million charge for recalls.

In a 26-page decision, Furman said reasonable investors “could, and likely would” interpret Fiat Chrysler’s statements about its safety compliance as suggesting that it was in substantial compliance with “all” applicable regulations.

He said that could be misleading, given how the NHTSA probes had begun, the automaker had begun closer monitoring of safety issues, and, “after all, only months later, FCA admitted to widespread noncompliance.”

But the judge said he would not allow a claim for what he called “fraud by hindsight” for suggesting that Fiat Chrysler underestimated the cost of its recalls.

“Misguided optimism is not a cause of action, and does not support an inference of fraud,” he wrote.

The case is Pirnik v. Fiat Chrysler Automobiles NV et al, U.S. District Court, Southern District of New York, No. 15-07199.