The firm agrees to fund improvements after Ofwat discovered "excessive spills from storm overflows".