Samsung today disclosed information about the causes of the exploding batteries inside its Galaxy Note7 flagship smartphone.

Following reports of incidents, the device was banned on U.S. flights, recalled, discontinued, and ultimately disabled through software updates, but until this point, Samsung had not fully explained the cause of the issues, which have had a material financial impact on the company.

Samsung built a test facility to conduct a thorough review, checking to see if fast charging, water resistance, the iris scanner, or the USB-C port may have played a role, DJ Koh, president of Samsung Electronics’ mobile communications business, said during a press conference. But after testing the assembled phones and batteries, the company determined that it was the battery and not the phone itself that caused issues, Koh said.

Specifically, there were two major issues with the two different versions of batteries for the Note7. There was an “electrode deflection and incorrect positioning of the negative electrode tip in the upper right corner of the battery” and “an abnormal weld spot [that] led to an internal short circuit,” according to a video the company released.

Exponent, TUV Rheinland, and UL also analyzed the Note7 to determine what had caused the phone’s issues. (The reports are available here.)

Koh apologized to customers, carriers, and retail and distribution partners.

In addition to releasing the reports, Samsung today also said it has deployed “multi-layer safety measures,” updated its battery safety checks, and formed a battery advisory group.

The timing of the Note7 meltdown was not good. The phone was collecting positive reviews and then, suddenly, reports of explosions started, and the narrative continued as Apple released the iPhone 7 and 7 Plus, the latter one of the Note7’s closest competitors. The iPhone 7 Plus has received many positive reviews even though it lacks a headphone jack. (Apple is no stranger to exploding batteries: There were cases of batteries exploding inside the Powerbook 5300 that it had introduced in 1995, and Apple ultimately recalled the laptops and replaced their batteries.) Another competitor, the Google Pixel XL Android phone, has also racked up positive reviews.

Earlier this month, Samsung said that more than 96 percent of its Galaxy Note7s had been returned.