Bank of America can't leave its troubled past behind it.

Shares of Bank of America(BAC) sank nearly 6% Wednesday, erasing all of the bank's 2013 gains.

The Charlotte, N.C.-based bank generated net income of $2.6 billion, or 20 cents per share, on $23.7 billion of revenue. Analysts expected Bank of America to earn 22 cents per share, on revenue of $23.4 billion.

Wall Street has been eager to see how quickly the bank, which many feel has a bloated cost structure, can slash expenses. Bank of America's expenses in the first quarter were $1 billion a lower than a year ago, on track with what it has forecast. But there are signs that cost cutting is crimping its growth.

"I didn't think this quarter was that bad, but I don't have high hopes for Bank of America," said Paul Miller, an analyst at FBR. "It's tough to grow revenues when you are shrinking your headcount."

While profits quadrupled from a year earlier, most of the gains are related to the bank's efforts to clean up its balance sheet, leaving investors unimpressed.

Legal worries persist:The bank continued its housecleaning in the first quarter, but not enough to quell worries about the litigation expenses that remain.

Bank of America settled three major class action lawsuits related to Countrywide's mortgages, paying $500 million to settle with shareholders who filed lawsuits between 2005 and 2007.

On pending litigation, chief financial officer Bruce Thompson said on an analyst call: "No one will ever declare a complete victory, but we are moving through the pipeline of items in a pretty meaningful way."

But analysts are still worried that Bank of America might not have held enough in reserves to pay for future litigation expenses.

"Persistently high litigation costs are likely to reinvigorate concerns about Bank of America's remaining mortgage related loss exposures," Sandler O'Neill analysts said in a research note.

Behind the numbers:Consumer banking is the largest division within the bank, and its revenue and profit dipped from a year earlier. Mortgage banking income also slumped from a year earlier.

Bank of America did manage to increase fees in its investment banking and wealth management division, at least partially offsetting dips in other divisions.

While investors weren't pleased, CEO Brian Moynihan tried to strike an optimistic tone. He said Bank of America is "balanced, focused and moving forward," citing growth across various business lines, including small business and middle-market lending, in addition to wealth management and investment banking.

Bank of America is the fifth major bank to report first-quarter results.

JPMorgan Chase(JPM) and Wells Fargo(WFC) disappointed the market with weaker-than-expected revenue, while Goldman Sachs(GS) made investors nervous with an increase in risky bets. Only Citigroup(C) got a thumbs up from investors after reporting profits and revenue that topped estimates.