Ruling ends power-plant agreements on fish kills