A federal judge narrowed Tesla Inc.’s lawsuit against a former employee it accused of hacking into its computers and leaking proprietary data to a reporter. The judge also dismissed a defamation counterclaim by the former employee.

In a decision on Thursday, Chief Judge Miranda Du of the federal court in Reno, Nev., said Tesla failed to show that Martin Tripp’s disclosure of confidential information caused a $167 million decline in the electric car maker’s market value.

But she refused to dismiss some other Tesla claims, including that Tripp’s alleged unauthorized use of data might have violated a Nevada computer crimes law, and that his conduct justified punitive damages.

The defamation counterclaim arose from four statements made by Tesla CEO Elon Musk or Tesla’s communications staff, but Du said none was false and Tripp could not show actual malice.

Tripp had worked as a process technician at Tesla’s Gigafactory near Reno.

Tesla fired him on June 19, 2018, one day before filing its lawsuit.

Tripp declined to comment on the decision on Friday. He represents himself in the case, according to court records.

Tesla did not immediately respond to requests for comment.

In its complaint, Tesla had accused Tripp of writing software to hack into its manufacturing operating system, and sharing stolen data with people outside the company, and making false claims to the media about information he stole.

Du said Tripp contended he was a “whistleblower” who had identified “production inefficiencies and delays in Tesla’s race to produce 5,000 Model 3 cars per week.”

Tesla, in contrast, believed Tripp reached incorrect conclusions about the effectiveness of the Gigafactory’s assembly lines, the judge wrote.

The case is Tesla Inc v Tripp, U.S. District Court, District of Nevada, No. 18-00296.