Profits at UBS rose almost 15 percent during the second quarter, even as the Swiss bank’s Wealth Management Americas (WMA) unit stumbled amid decreased client transactions and litigation costs.

UBS reported a net profit of $874 million for the second quarter, up from $762 million in profits reported a year ago. “We delivered strong underlying results in a market environment that remained challenging for our clients and the industry,” Group CEO Sergio Ermotti said Tuesday.

But the bank’s results were tempered by the disclosure that UBS is responding to several investigations by the U.S. Securities and Exchange Commission, the New York State attorney general and FINRA regarding dark pools, or private electronic trading venues that allow investors to buy and sell shares anonymously. UBS also revealed that it had settled a cross-border tax dispute with Germany for $403 million.

Overall, the bank spent $280 million during the second quarter on litigation and regulatory matters. These litigation charges, as well as legal expenditures relating to Puerto Rican securities, cut into profits for the wealth management division. 

UBS Wealth Management Americas reported a pre-tax profit of $238 million, down 13 percent from the unit’s first quarter profit of $272 million and down 3 percent from a year earlier. The adjusted pretax profit for the quarter was $246 million. UBS Wealth Management Americas experienced net new money outflows of $2.5 billion, mainly due to client withdrawals around seasonal income tax payments. 

“Overall, the significant drop in transaction volumes impacted revenues and margins,” Ermotti said on Tuesday’s earnings call, speaking of the U.S. wealth management unit.

Despite the lower profits, UBS Wealth Management Americas set records in the number of invested assets and advisor productivity during the second quarter. Invested assets hit $1.02 trillion for the second quarter, up from the $987 billion reported in March and up 14 percent from a year ago.

Productivity for UBS Wealth Management Americas’ 7,119 financial advisors also hit all-time highs. Invested assets per advisor reached $143 million last quarter, up 13 percent from $126 million reported a year ago.

Wealth Management Americas reported revenue-per-advisor was about $1.07 million in the second quarter, up 3 percent from $1.04 million reached during the first quarter and 6 percent from $1.01 million last year.