(Reuters) - Wells Fargo & Co reported higher quarterly earnings on Tuesday, due in part to lower expenses, but the bank reined in its outlook for cost cuts to invest in improving its risk management.

FILE PHOTO: A Wells Fargo ATM machine is shown in Los Angeles, California, U.S. October 19, 2018. REUTERS/Mike Blake/File Photo

Executives warned on a call with analysts that expenses will come in at the high end of its forecasted range for 2019 and that 2020 expenses will likely be flat with 2019, instead of lower as previously expected.

Lower costs were a primary driver of earnings in the most recent quarter and were a cornerstone of former CEO Tim Sloan’s plan to deliver higher profits while the bank worked on moving past its scandals. The bank’s new strategy shows the two goals may have been incompatible.

“We’ve seen a greater need for us to make investments in terms of risks, compliance and audit, all those things that we’re going to need to make investments in, in order to satisfy the requirements of our regulators,” said Interim Chief Executive Allen Parker.

Parker was thrust into the job in March when former CEO Tim Sloan resigned abruptly, saying pressure from politicians and regulators had become a distraction in running the scandal-plagued bank.

Wells Fargo has been under a regulatory microscope since revelations that the bank had opened potentially millions of unauthorized accounts in 2016. Internal and regulatory probes have since discovered other issues in each of the bank’s primary segments, resulting in billions of dollars in fines, penalties and an unprecedented cap on its balance sheet by the Federal Reserve.

During his tenure so far, Parker has prioritized resolving lingering issues from the bank’s scandals. In May, he formed a new unit tasked with satisfying U.S. regulatory requirements.

The bank has hired thousands of employees to focus on risk controls and those personnel expenses have partially offset the bank’s other cost-saving initiatives like headcount reductions in other areas of the bank and branch closures, said Chief Financial Officer John Shrewsberry.

The fourth largest U.S. bank by assets, has leaned on cost cuts to stabilize its bottom line amid sluggish revenue trends in the wake of its scandals. Now the San Francisco-based bank must also contend with fresh macroeconomic uncertainty from a changing interest rate environment that’s pressuring lending margins across the industry. The U.S. Federal Reserve is widely expected to cut rates later this month.

Wells Fargo became the third big bank to report contracting net interest margins, a closely watched metric that measures the difference between how much a bank is charging on its loans and how much it pays for deposits. The figure dropped 11 basis points to 2.82% in the most recent quarter.

Wells Fargo has cut its net interest income guidance twice to reflect the broader economic outlook. Wells Fargo relies heavily on interest rates to pad its revenue since it has tons of rate sensitive deposits and mortgage securities.

Still, The bank showed that it was it was able to grow its loan book despite macroeconomic headwinds.

Total loans grew 0.6% to $949.88 billion in the quarter.

“This the best loan growth seen in over two years at the company, which is an encouraging sign,” said Edward Jones analyst Kyle Sanders.

Deposits were roughly flat at $1.3 trillion.

Net income applicable to common stock rose here&u=urn:newsml:reuters.com:20190716:nBw7qdcmPa to $5.85 billion, or $1.30 per share, in the second quarter, from $4.79 billion, or 98 cents per share, a year earlier. Revenue was flat at $21.6 billion.

Analysts had expected a profit of $1.15 per share and revenue of $20.9 billion, according to IBES data from Refinitiv.

Wells Fargo shares were down 2.7% to $45.45 in afternoon trading.