Shortly after the stock market closed, longtime Enphase Energy CEO Paul Nahi announced that he is leaving the company, which took some of the air out of a second-quarter conference call that indicated the company may be headed toward a more stable financial future.

Nahi spoke first on the call and, after giving the numbers on the second quarter, announced he was resigning from the company effective today but that he will help the company make its transition to the new CEO.

Steve Gomo, lead independent director of Enphase Energy’s Board of Directors, said the company expects to name a new CEO by Aug. 31. In the interim, the board of directors has created an “Office of the CEO” group consisting of consisting of Bert Garcia, CFO, and Badri Kothandaraman, COO, to keep day-to-day operations moving forward. The group will report directly to the Board.

Gomo said the company had been discussing with Nahi about his departure for some time, which is why he is confident they will be able to find a new CEO on such a tight deadline. “The search is already well under way, and we’re looking at both internal and external candidates,” Gomo said.

For his part, Nahi said it had been an enormous privilege to lead Enphase since inception and through its growth to become a leading global energy technology company.

“Having managed Enphase from a concept through global leadership, I feel the time is right for a new CEO to continue its growth, while Enphase increases marketshare, expands into new geographies and explores new opportunities,” Nahi said. “I remain passionate about Enphase’s bright future, and I am confident its best days are yet to come.”

During the second quarter of 2017, Enphase said it sold approximately 224 MW (DC) or 775,000 microinverters, an increase in MW of 39% compared to the first quarter of 2017. The company added that it generated $1 million of cash in the second quarter of 2017 and exited the quarter with a total cash balance of $31 million.

But the news wasn’t entirely sunny. The company reported a net loss for the second quarter of 2017 was $12.1 million, or a net loss of $0.14 per share, compared to a second quarter of 2016 net loss of $16.7 million, or a net loss of $0.36 per share. The company lost $22 million in the first quarter of 2017.

The company reported operating expenses for the second quarter of 2017 were $22.8 million, a decrease of 22% compared to the first quarter of 2017 and a decrease of 24% compared to the second quarter of 2016. The decreases were not unexpected, as Enphase Energy has been undergoing a significant restructuring as the company struggled to find its new niche as competitors started to erode its marketshare.

Enphase said its revenue for the third quarter of 2017 will within a range of $72 million to $80 million and its operating expenses for the third quarter are expected to be between $22.5 million to $24.5 million.

Under Nahi’s leadership, Enphase Energy pioneered the concept of the microinverter and for many years were the leader in the market. In recent years, however, the company has struggled financially as more competitors started to encroach on its marketshare. In June, the Nasdaq Stock Exchange warned Enphase that they could be delisted if its stock price didn’t recover significantly.

On the call, Kothandaraman said the company believes its second-quarter performance shows the company has turned the corner, and that it was in part thanks to Nahi’s leadership.