Lyft is bringing its rentable, pedal-assist electric bikes back to San Francisco five months after several battery fires forced the company to pull them from service.

The e-bikes were only in service for two months when Lyft pulled a thousand of them from service to investigate a handful of reported battery fires. The bikes were also pulled from San Jose and Oakland. Lyft had previously been forced to ground its fleet of e-bikes in New York and Washington, DC after a braking malfunction injured several riders. It is still unclear when those bikes will be returned to service.

Last week, the San Francisco Municipal Transportation Agency (SFMTA) said it struck a four-year deal with Lyft to operate a “hybrid” model of bike-sharing that includes docked and dockless bikes. Under the agreement, Lyft will begin to deploy 4,000 e-bikes in December, with a fuller rollout expected by April 2020.

The announcement marks the end of a tumultuous summer for Lyft

After investigating the “root causes” of the battery fires, Lyft said it made the decision to switch suppliers. The company is now testing the new batteries and reassembling its fleet of e-bikes in preparation to redeploy them in San Francisco “in the coming weeks and months.”

The announcement marks the end of a tumultuous summer for Lyft, which owns the largest bike-share operator in the US. In addition to the battery fires and the braking malfunctions, there was also legal wrangling between the ride-hail company and the city of San Francisco.

The company sued the city in June to prevent San Francisco from seeking other third-party contracts; Lyft claims it has a 10-year contract that gives it sole control of the dockless bike-share market. SFMTA argued that Lyft only had exclusive rights over docked bikes in the city.

In July, a San Francisco judge issued a preliminary ruling in favor of Lyft and enjoined the city from permitting more dockless bike providers. The judge also distinguished between pedal bikes and e-bikes and gave the city and Lyft 90 days to negotiate a new provider deal for e-bikes.

According to SFMTA, the new e-bikes will work as “hybrids” that can be docked at stations but also locked to bike racks around the city. This model will help “expand the reach of the system and provide citywide access to bikeshare,” the agency says.

As for Uber, it will be allowed to continue operating its fleet of 500 dockless Jump e-bike in San Francisco until at least March 1st when its permit expires. “We applaud the City of San Francisco for not waiving its right to challenge Lyft’s claimed bikeshare monopoly in court, and we look forward to protecting riders’ rights to choose the transit option that fits them best by continuing our operations in San Francisco,” a spokesperson said.