Earnings season is now underway, and investors were curious to hear from Wells Fargo (NYSE:WFC) to see how it's recovering from its 2016 fake-accounts scandal. And as we just learned, the bank's results for the quarter were mixed. While the bank earned a higher profit than analysts had expected, revenue fell short for the quarter. Here are some of the key takeaways from the report -- and why Wells Fargo could be a bargain.

Wells Fargo's second-quarter results were mixed

As of midday on the day of Wells Fargo's earnings announcement, the stock had fallen by 2%. And to be perfectly clear, there's a reason for the drop.

Bright future concept.

2016 was a rough year for the bank, but the future still looks bright. Image source: Getty Images.

Specifically, while the bank beat estimates on the bottom line, revenue was about $300 million less than analysts had been expecting. The bank earned $1.07 per share, handily surpassing the $1.01 Wall Street was looking for, but its revenue of $22.17 billion didn't meet the $22.47 billion expectation. In addition, earnings from the other two big banks that reported on the same day, JPMorgan Chase and Citigroup, disappointed investors and contributed to sector weakness.

However, there was a lot to be happy about. Deposits increased by 5% year over year, while the loan portfolio grew by 1%. Asset quality got even stronger, with an annualized net charge-off ratio of just 0.27%, down from 0.39% a year ago.

Rising interest rates have helped the bank's margins expand. Net interest margin grew to 2.90% in the second quarter, up from 2.87% in the first quarter and 2.86% in the same quarter last year.

This quarter shows the bank remains strong

There was some concern after the bank's first-quarter earnings, specifically about the efficiency ratio, return on equity, and return on assets metrics. I wouldn't call any of the results "bad," but they were low for Wells Fargo.

The good news is that during the second quarter, these metrics all rebounded. Efficiency improved significantly, while ROE and ROA were even stronger than they were a year ago, before the now-infamous fake-accounts scandal was revealed.

Metric

Q2 2017

Q1 2017

Q2 2016

Efficiency ratio

61.1%

62.7%

58.1%

Return on assets (ROA)

1.21%

1.15%

1.20%

Return on equity (ROE)

11.95%

11.54%

11.70%

Return on average tangible common equity (ROTCE)

14.26%

13.85%

14.15%

Data source: Wells Fargo's Q2 2017 Earnings Release.

While I don't think the scandal is completely in the rearview mirror just yet, these results are certainly promising, and they show that Wells Fargo's history of being the most profitable big bank continues.

Management seems to think the stock is cheap

One part of the bank's quarterly report that caught my eye is Wells Fargo's capital plan, which was recently approved by the Federal Reserve. The one-cent dividend increase isn't likely to turn any heads, but the buyback plan is the real story, here.

Specifically, Wells Fargo's capital plan includes up to $11.5 billion in common stock buybacks, over the one-year period from the third quarter of 2017 through the second quarter of 2018. This is a substantial increase over prior buyback authorizations. For reference, the bank repurchased a total of about $5 billion of its common stock for the entire year of 2016.

The takeaway is that instead of increasing the dividend more aggressively, the bank's management has chosen to emphasize buybacks, which leads me to believe that management feels the stock is attractively valued at its current price.

This would certainly make sense, given the stock's recent performance. Over the past year, the financial sector as a whole has increased by nearly 31%, while Wells Fargo has significantly lagged its peers with a 13% gain.

WFC Chart

WFC data by YCharts.

Not without risk

To be clear, Wells Fargo could still have some lingering fallout from its infamous fake-accounts scandal, as well as risk from other legal issues. And, it could take a while before the effects of these issues are in the past. In fact, just this week, Federal Reserve Chair Janet Yellen had some harsh words for the bank and is prepared to take action against the bank if it turns out to be warranted. In other words, the stock has underperformed for a reason.

However, Wells Fargo remains a highly profitable institution with disciplined risk management, and there's no reason to think this won't be the case for years to come. So, while the stock may experience some short-term volatility, the long-term outlook for the bank still looks promising.

Matthew Frankel has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.