The U.S. Environmental Protection Agency said Monday it has reached an agreement to settle a case with Tesla related to hazardous waste violations at the electric carmaker’s Fremont manufacturing facility in 2017.

The EPA said in a statement that it led unannounced inspections at Tesla’s Fremont factory nearly two years ago, which determined that Tesla failed to comply with several EPA standards and requirements. Those included the company being in non-compliance with air emission standards for leaky equipment, a failure to meet requirements for generators of hazardous waste and not making adequate hazardous waste determinations for certain types of solid waste produced at the Fremont plant.

“It’s vital that businesses comply with hazardous waste laws that keep facilities safe for workers and the community,” said EPA Pacific Southwest Regional Administrator Mike Stoker, in a statement announcing the settlement.

As part of its settlement, Tesla agreed to pay a fine of $31,000 to the EPA, and also purchase $55,000 worth of emergency response equipment for the City of Fremont Fire Department. The equipment includes a drone aircraft that can be used to carry hazardous material sensors, cameras and other equipment, and a drone detection device that will be used to prevent unauthorized drones from flying near an emergency scene.

A Tesla spokesperson said that since EPA visit 16 months ago, “all gaps identified in the inspection have been resolved by Tesla,” and that the company “has made great strides in its environmental program and its ongoing (regulatory) compliance.”