Wells Fargo’s better-than-expected earnings contributed to stock gains for the financial sector, but this good news could be short-lived, as analysts look at what lies ahead for the beleaguered bank.

Wells Fargo beat analysts’ expectations when it reported second-quarter earnings on Friday of $1.20 per share, above the consensus forecast of $1.09 per share. It recorded $21.6 billion in revenue versus $21 billion expected.

But its stock fell even as the broader market rallied on the strength of record earnings from JPMorgan Chase and the announcement of a new video streaming service from Disney.

“Numerically, for the quarter, earnings were okay but management dropped guidance, in particular, for net interest income for the full year,” said Morningstar analyst Eric Compton. “There’s still just a lot of negatives overhanging that."

“Fundamentals remain challenged with loan and deposit balances declining,” David Long, managing director of equity research at Raymond James & Associates, wrote in a research note. Long also noted lower net income on interest, and noninterest income that came in lower than expected.

It struggled with lending, as well. “Loan growth was pressured by declines in all categories except [commercial real estate], while deposit balances were lower for both interest- and noninterest-bearing balances,” Long said.

While the banking sector overall faces the risk of slowing global economic growth and deteriorating credit quality, Wells Fargo also faces self-inflicted problems, with a tarnished reputation and regulatory disciplinary actions stemming from a huge fake-account scandal.

Just two weeks earlier, the bank caught the market by surprise by announcing CEO Tim Sloan, a three-decade veteran at the company who became chief executive in 2016 following the departure of John Stumpf, will leave by the end of June.

“It isn’t good to see a bank without an official leader,” Compton said. “It’s not the best situation, for sure.”

Stumpf had been at the helm when the bank was conducting activities that would eventually cost it billions in fines and penalties, from opening up accounts without customers’ knowledge and then charging them fees, to requiring customers to pay for unnecessary services and overcharging them on others.

Earlier in March, Sloan had come under fire from Washington and Wall Street alike for his testimony to Congress, during which he faced bipartisan ire from Representatives on the House Committee on Financial Services who questioned whether or not the bank had really changed its ways.

Following the announcement of his departure, vocal bank critic Sen. Elizabeth Warren, D-Mass., weighed in, tweeting, “Tim Sloan should have been fired a long time ago. He enabled Wells Fargo's massive fake accounts scam, got rich off it, & then helped cover it up.”

What Sloan’s sudden replacement by general counsel and interim CEO Allen Parker ultimately means for Wells Fargo is less than clear. “At this stage, it is difficult to draw any firm conclusions on what this change means, given that the range of potential successors is wide,” Goldman Sachs analyst Richard Ramsden wrote in a note to clients.

“I think what happened at Wells is the culture and the systems had been so ingrained with all these different mechanisms for basically overcharging their customers and not doing right by them,” said banking analyst Bert Ely. “It’s not an overnight job to change the culture and eliminate these processes.”

Doing so will be a big job, one which has ramifications for choosing Sloan’s successor, Ely said.

“There’s no question the next CEO has to come from outside,” he said. “The challenge is, who’s that going to be?”