Allegheny County, home to the city of Pittsburgh and its surrounding suburbs, settled a lawsuit over the numerous instances of dead voters and duplicate registrants on its voter rolls.

The county entered into a settlement on Monday with the Public Interest Legal Foundation, an election integrity group, after its manager of elections and three members of its board of elections were sued. The election watchdog found that the county’s voter rolls contained nearly 1,600 dead registrants, close to 7,500 with erroneous information, and more than 1,500 aged 100 or above (including 49 born in the 1800s). The suit accused the officials of failing to reasonably maintain the rolls.

As part of the settlement, the county has agreed to turn over records related to the dead registrants, send letters to registrants with incorrect dates of birth on file, inspect registrations of individuals aged 110 years or older to determine whether death notices were overlooked, and to accept “list maintenance leads” from the watchdog over the course of the next year.

The voter roll cleanup comes six months ahead of the 2020 elections in a region that will play a pivotal role in determining which presidential contender will take Pennsylvania. President Donald Trump won the state by fewer than 45,000 votes in 2016.

J. Christian Adams, president and general counsel of the Public Interest Legal Foundation, said the county deserves credit for agreeing to fix the “serious problem with elections there.” He said some Allegheny County residents have been registered “two, three, four, even seven times to vote.”

“We found those problems, and the County agreed to fix them,” Adams said. “This settlement demonstrates what can be accomplished when good government groups work with election officials in good faith without the interference of ideologically driven activists who oppose such measures. Those same activists push radical changes to vote by mail, which shows how important this settlement was for a clean election in Pennsylvania.”

Adams’s group also has an identical lawsuit in Detroit over the city’s voter roll irregularities, which also include thousands of dead people registered to vote.