The Federal Reserve approved the capital plans of 29 of the nation’s 31 largest banks on Wednesday as part of the final leg of its annual stress tests.

Bank of America BAC was the most notable bank to struggle during this portion of the tests. The Fed said that BofA had “deficiencies” in predicting how well it would perform in an economic downturn. The Fed also said it found “weaknesses” in BofA’s internal controls. A Fed official declined to elaborate what those deficiencies or weaknesses were.

Nevertheless, the Fed did not reject BofA’s capital plan. Instead, it has asked the bank to resolve the issues and resubmit its plan by the end of September.

The Fed did not reject any of the U.S. banks’ capital plans. But three large banks—Goldman Sachs GS , JPMorgan Chase JPM , and Morgan Stanley MS —had to resubmit their capital plans, either lowering their dividends or the amount of money they were going to use to repurchase shares, in the past week to pass the test. The Fed said that, without the resubmitted plans, those banks would have failed the stress test. It was the second year in a row that Goldman was asked to resubmit its plan.

The two banks that failed were U.S. divisions of foreign banks Deutsche Bank and Santander Holdings. The rejections technically ban both banks from increasing their dividends or share repurchases for the next year, something shareholders have been eagerly anticipating. But when it comes to foreign banks, the Fed may have limited ability to enforce such restrictions. Santander, last year, for example, upped the dividend it paid to shareholders of a U.S. division of its bank despite failing the test. The bank, however, got in trouble with the Fed for doing this. Despite being told that it was in danger of failing the stress test, Deutsche declined to resubmit its capital plan. Santander resubmitted its capital plan, but it still failed.

Still, the stress test results show once again, the nation’s largest banks are in far better shape than they were going into the financial crisis, and better than they were even a year ago. In a statement, the Fed said, “U.S. firms have substantially increased their capital since the first round of stress tests led by the Federal Reserve in 2009.”

Most banks submitted plans to the Fed to increase their dividend or buy back shares. Both moves generally boost share prices and are cheered by investors, but they can deplete needed capital to cover losses from loans or bad investments. Banks used to be able to up these payouts without much oversight. But since the financial crisis, they now must receive approval from the Fed each year to implement these distributions.

Bank of America’s conditional pass comes as a bit of a surprise. The bank appeared to be a top performer on the first part of the Fed’s stress test, which was released last week. But BofA has struggled with stress tests in the past. Last year, it was among a group of banks that were asked to resubmit their plans. What’s more, about a month after last year’s test, BofA admitted that it had somehow overlooked $4 billion in losses that it had incurred over the previous few years. That forced the bank to once again resubmit its capital plan to the Fed. That mess-up could in part be what led the Fed to determine this year that BofA has a few weaknesses in its internal controls that it needs to address.