For many companies, a disaster on the scale of the Note 7 debacle would have caused irreparable damage. But Samsung isn’t just about smartphones. Despite two recalls and the resulting PR nightmare, Q4 2016 was the tech giant’s most profitable quarter in three years.

Samsung reported an operating profit of KRW 9.22 trillion ($7.92 billion) on total revenue of KRW 53.33 trillion (about $45.8 billion) for the last quarter, marking an increase of more than 50 percent compared to the same period one year earlier. The figures were in line with expectations revealed earlier this month.

The Note 7 fiasco may cost Samsung around $5 billion in lost sales, but that loss will be spread across several quarters – it mostly affected Q3 2016, which recorded Samsung’s worst operating profit in two years. Moreover, the company’s other businesses continue to do exceptionally well. Its chip sector had a record quarter, boasting operating profits of KRW 4.95 trillion ($4.25 billion), up 77 percent from the same period in 2015. And its display business also helped boost the quarter’s figures.

“Robust sales of high-end, high-performance memory products and expanded process migration in V-NAND, plus strong shipments of OLED and large-size UHD panels contributed to profitability,” Samsung wrote in a statement.

The company admitted that the strength of the dollar against the Korean won was a factor behind the impressive results. The company conducts component deals in US dollars, which helped boost the sector’s profits.

Handsets such as the S7 and S7 Edge remain popular, and Samsung continues to experience solid sales of mid-range devices. The company’s mobile division posted a YoY profit increase of around 4 percent to about $2 billion.

Samsung expects slow growth in the first half of 2017, with  “weak demand for smartphones and tablets forecast due to seasonality.” It hopes the Galaxy S8 and Note 8 will help the company strengthen “its leadership in the premium market."