Officials in Virginia and Maryland are taking steps to avoid a repeat of the 2012 elections, when some voters experienced long delays at polling stations, according to a recent federal report.

About 12 percent of all voters in both states had to wait for more than hour, sometimes outdoors in chilly weather, before casting their votes, the Government Accountability Office found. Maryland, Virginia and Florida were the nation’s three worst-performing states in terms of delays.

Election officials said they have bought new equipment; carved out smaller, more manageable precincts; and trained volunteers in better management of long lines in an attempt to avoid repeating the problem on Nov. 4.

“There’s a lot that’s been going on around the state,” said Edgardo Cortes, commissioner of Virginia’s Department of Elections. Like officials in Maryland, Cortes predicted shorter lines during the midterm elections.

Though problems with voting often stem from such mundane issues as faulty equipment, delays can be viewed suspiciously, especially in jurisdictions with a history of voter discrimination.

That was the case in Prince William County, where in 2012, the mostly African American voters who showed up to vote at River Oaks Elementary School were forced to wait outside for as long as four hours.

“I don’t believe it was by design that this was a largely minority precinct that was affected, but it was nonetheless the effect,” said Rep. Gerald E. Connolly (D-Va.), who, after holding community hearings, pushed for the GAO report that was completed and made public last month.

“It was minority communities that were mostly affected, and that has the effect of discouraging voter participation in the community,” Connolly said. “That is what we want to make sure does not happen again.”

Connolly and other members of Congress have pushed for legislation that would give grants to states based on how well they meet several criteria, including expanding early voting and registration opportunities, cutting wait times at polling places and boosting training for poll workers.

“The franchise is sacred,” Connolly said. “We’ve got to make sure we do everything possible so that everyone who wants to cast a vote is able to cast that vote.”

The GAO report was based on a survey of the nation’s 10,500 local elections offices, with specific questions addressed to Prince William County and four other municipalities where voters experienced lengthy waits. It found that delays were caused by overly long ballots, outdated equipment and poor management inside voting precincts.

Rokey Suleman, interim general registrar of the Prince William County elections office, said officials there have created four new precincts out of what were larger precincts whose turnout overwhelmed volunteers in 2012.

The county is training volunteers to better handle long lines and will monitor wait times to see if other fixes are needed for 2016, Suleman said.

The county is in the process of purchasing new voting machines, Suleman said.

Fairfax County will unveil its new machines during the November election.

Suleman said his staff will be watching for any delays connected to a new Virginia law that requires a state driver’s license or another valid ID to be shown before voters can cast a ballot.

“It’s an added component that could slow things down,” he said.