U.S. banks noted improvements in delinquency and credit losses in the second quarter, but uncertainty remains given the slow economic recovery and elevated levels of REO, Standard & Poor's said in a report. Analysts continue to review the adverse conditions in the housing market and the impact of new rules and legislation on the industry. The ratings giant also is studying the possible costs of representation and warranty lawsuits against banks in relation to losses on mortgage-backed securities. Legal expenses at Bank of America (BAC) and JPMorgan Chase (JPM) more than doubled in the second quarter from the previous period. BofA reported $1.9 billion in litigation expenses for the quarter — most of it related to foreclosure and mortgage issues — up from $785 million for the first quarter. S&P said the rating outlook remains negative for banks that receive "explicit uplift  in their ratings from extraordinary government support" as analysts evaluate each bank's stand-alone credit, as well as the "support framework." "Adding uncertainty to our forecast is our downgrade of the U.S., rising debt burdens for European sovereigns, new regulations and the legal fallout from the 2008-2009 crisis," the ratings agency said. Institutional Risk Analytics said many banks are doing well despite the housing woes and "will continue to outperform and provide a haven from the storm in housing, a storm that will continue for some months and years to come." "Given the events of the past several days, we thought we would remind one and all that the overall condition of the U.S. banking industry is improving even as the abnormal risks related to housing haunt the top servicer banks," said Christopher Whalen of Institutional Risk Analytics. "The large cap banks tend to trade like macro stories in these days of uncertainty and indecision in Washington ... with no rhyme or reason to the movement one day to the next," Whalen said. Write to: Kerri Panchuk.