Wells Fargo’s third-quarter profit dropped 18%, caused by a significant increase in the bank’s legal expenses tied to its mortgage practices before the financial crisis.

The increase in legal expenses comes as the San Francisco-based bank tries to move beyond its recent scandals involving unauthorized…