Wells Fargo, the nation’s second-biggest mortgage lender, said that its financial performance improved in the fourth quarter – despite the ongoing impact of the coronavirus pandemic.

The bank originated $53.9 billion of residential mortgages in a white-hot Q4, a year-over-year decline of 12.5%, according to its earnings report released Friday. Its rival, JPMorgan Chase, reported a 12% increase on its loan production during the period, up to $32.5 billion.

Overall, the firm’s profits rose 4% ($3.0 billion) in the fourth quarter, with its home lending business up by 2%.

However, Wells Fargo CEO Charlie Scharf said that although the company has seen its profits improve, their results “continued to be impacted by the unprecedented operating environment and the required work to put our substantial legacy issues behind us.”

The bank’s profit for Q4 2020 was $3 billion (64 cents per share), down from Q4 2019’s earnings of $2.87 billion (60 cents per share). Its total revenue of $17.93 billion in the period exceeded analysts’ expectations of $18.1 billion. Meanwhile, Wells Fargo also saw its net interest income fall by 17% due to lower interest rates.

As for COVID-related forbearances, the company reported that 10,544 first-lien mortgages it services have deferral status, compared to JPMorgan’s $23.5 billion of loans in deferral.

Like many businesses, Wells Fargo has had its fair share of challenges during the COVID-19 crisis. The bank has set aside $3.83 billion in the first quarter to cover potentially “bad” loans caused by the pandemic and the subsequent recession. In the second quarter, the lender posted a $2.4 billion loss– its first quarterly loss since the housing bubble burst in 2008. Wells rebounded somewhat in Q3 with $2 billion in profit.

“Our agenda is clear, and we are making progress. We have prioritized and are moving forward on our risk and control buildout – the recently terminated BSA/AML consent order is just one of many, but it is an important step forward; we have a new management team in place; the disciplines we use to manage the company are completely different than one year ago; we have clarified our strategic priorities and are exiting certain non-strategic businesses, and we have identified and are implementing a series of actions to improve our financial performance,” Scharf said.