Tesla Chief Executive Officer Elon Musk did not unjustly enrich himself when he guided the electric vehicle maker in 2016 to acquire SolarCity Corp, where Musk was chairman and the largest shareholder, a Delaware judge ruled on Wednesday.

Tesla (TSLA) shareholders had accused Musk of coercing Tesla (TSLA)’s board into buying SolarCity, a struggling rooftop solar panel maker, to rescue his investment, and had sought up to $13 billion in damages.

The ruling comes as Musk is tapping his vast fortune to acquire Twitter (TWTR), which accepted his $44 billion offer on Monday. It also followed a ruling from a separate court earlier in the day that denied a Musk bid to end oversight of his Tesla tweets.

“The preponderance of the evidence reveals that Tesla paid a fair price — SolarCity was, at a minimum, worth what Tesla paid for it, and the acquisition otherwise was highly beneficial to Tesla,” said the opinion by Vice Chancellor Joseph Slights of Delaware’s Court of Chancery.

The ruling can be appealed and a lawyer for the shareholders said he was evaluating potential next steps.

“The case is about loyalty. The court’s decision acknowledges that Elon Musk was conflicted and there were flaws in the process,” said Randall Baron, the attorney for the plaintiffs.

There was no immediate response from Tesla or Musk.

Slights said Musk was more involved than he should have been, but a fair price for SolarCity outweighed claims the deal unjustly enriched Musk.

The ruling follows a 10-day trial in July which included nearly two full days of testimony from Musk.

Union pension funds and asset managers alleged that Musk commandeered Tesla’s negotiations for SolarCity while publicly claiming to be “fully recused.”

Slights said Musk on several occasions was involved in board discussions of the deal, but he also noted several instances when the board stood up to Musk and declined to follow his wishes, such as the timing of the deal.

The all-stock deal was valued at $2.6 billion in 2016.

Tesla’s stock price has since soared, inflating the value of what Musk received from the SolarCity purchase and in turn the damages sought by the plaintiffs.

Musk, the world’s richest person with a fortune of around $265.6 billion according to Forbes, had owned about 22% of both companies at the time.