After purging more than 300,000 voters from the rolls, Georgia election officials restored roughly 22,000 of them Thursday, citing an error in the way their voting history had been screened.

Secretary of State Brad Raffensperger’s office said the issue stemmed from the way the process of maintaining the voter list was carried out in 2015.

The affected voters either voted or had some other type of contact with the voter registration system in early 2012, but essentially weren’t given credit for it.

Raffensperger’s office on Monday purged 308,753 voter registrations that were deemed inactive. A federal judge is set to hear arguments Thursday afternoon about whether some of them should be reinstated, after a voting rights advocacy group founded by Democrat Stacey Abrams filed an emergency motion earlier this week asking the court to stop part of the purge.

“When the list-maintenance process was begun in June of 2015, it searched for the registrations of people who had not voted or had any other type of contact with their county elections office (like submitting an updated registration, requesting an absentee ballot, or signing a petition) since before June 1, 2012, and classified them as inactive voters,” a statement from the secretary of state’s office says.

Walter Jones, spokesman for the secretary of state’s office, says the search should have looked for registrations of people who had not voted or had other contact since Jan. 1, 2012, rather than June 1. “Somebody did fiscal years instead of calendar years,” Jones told The Associated Press.

The statement from the secretary of state’s office says that instead of being purged, the 22,000 people affected will be moved back to inactive status, giving them more time there before being removed from the rolls.

Raffensperger’s office has defended the list maintenance, saying it makes the administration of elections smoother and helps guard against voter fraud.