Escalating rage over the role of ACORN in registering presumably Democratic voters threatens to undermine the political legitimacy of a Barack Obama victory Nov. 4. And perhaps that's the point. But if John McCain were well ahead in the polls, the left would undoubtedly be shouting about electoral-system failures to de-legitimize a GOP win. It is too late to tone down the rhetoric for 2008, but if we want to end these sorts of attacks, there's only one solution: States must become more serious about how they administer elections.

The ACORN controversy -- in which hundreds of thousands of registration cards gathered by the Assn. of Community Organizers for Reform Now, including some that were fraudulent, were rejected by election officials -- represents nothing new. Republicans have been charging that Democrats inflate voter rolls for decades; likewise, Democrats accuse Republicans of suppressing legitimate votes.

But this year that hoary chestnut has collided with laws intended to make voting easier, particularly the 1993 National Voter Registration Act, or the "motor voter" law, and the 2002 Help America Vote Act, or HAVA. The first requires states to allow registration at a wide variety of government agencies and by mail. The second requires states to maintain centralized, computerized voter registration lists and to compare names against those in other government databases, such as driver's licenses.

ACORN and similar groups have undertaken massive voter registration drives because many states have been reluctant to follow through on their motor-voter obligation. In some cases, this is simply because social service agencies and motor vehicle offices are struggling to perform their core functions, much less provide voter registration services. But some state governments simply have decided not to comply. Either way, millions of eligible voters still find it hard to register.

HAVA also revealed the poor condition of many states' core databases: Comparisons between the voter rolls and driver's licenses have yielded hundreds of thousands of mismatches -- almost all of which are because of clerical problems such as typos, not fraudulent registrations.

In this context, the ACORN scandal might seem to be the final push toward turning 2008 into the perfect storm of election chaos. Despite its aggressive quality control, ACORN's business of paying people for each new registration has become a meaty treat for right-wing carnivores. When McCain warns that ACORN is "on the verge of maybe perpetrating one of the greatest frauds in voter history in this country, maybe destroying the fabric of democracy," he is setting the stage for his followers to refuse to accept the result of the election.

Of course, the left has its own favorite election-horror narrative: the failure of electronic voting machines. The most extreme tales have the election of George W. Bush in 2000 and 2004 as literally hardwired by the voting equipment in Ohio. These suspicions too are a product of election reform legislation gone awry.

HAVA virtually mandated that every precinct have at least one direct recording electronic voting machine to allow disabled persons to vote unaided. As more and more localities replaced all of their equipment with electronic machines, the manufacturers began shooting themselves in the foot. CEOs promised to help "deliver the votes" to Bush in 2004. Touch screens sometimes froze. Computer code was shown to be poorly written. The design was vulnerable to easily anticipated operator error. In addition, there were highly visible (if sometimes dubious) demonstrations by hackers, computer scientists, students and activists to show what could happen if someone with access really wanted to do harm.

But as Democratic fortunes have improved this year, panic about rogue voting machines has virtually disappeared. And it is clear why. With Obama's lead in the polls solidifying, stories about hacked voting machines no longer motivate Democrats. Furthermore, if Obama is likely to win, why hint at the possibility that the outcome could be subject to manipulation -- even if the opponent would do the alleged manipulation?

To be clear, for those concerned about voter fraud and voting machine malfunctions, there is plenty to be worried about. However, thousands of hours of analysis by dispassionate researchers have uncovered virtually no election fraud, even though the voter lists are flawed. And even though the machines sometimes break down, there is no demonstrated case of an electronic voting machine being maliciously hacked in any American election.

So, eight years after the Florida hanging-chad fiasco, we find ourselves in a deep irony. Elections undoubtedly are better-run now. However, a combination of greater media attention to election-system failures, transitional chaos and razor-thin election margins have increased anxieties. Unfortunately, as the recent turn against ACORN has reminded us, it is a small step from attacking shenanigans to creating the impression among partisans that the other guy won by fraudulent means.

What to do? To stop attacks on voting machines (and thus remove any taint from Republican victories), states need laws that ensure a clear chain of custody for all machines and ballots before an election, require thorough audits of the machines after an election and make all software open to public scrutiny. Some states, including California, have made progress in this area, but most have not.

To stop attacks on groups like ACORN (and thus remove any taint from the victories of Democrats), states must do a much better job of registering new voters. The best practice in this regard is election-day registration, which puts the business of voter registration back in the hands of election officials, where it belongs, in a setting that is the extreme of convenience for voters. Eight states allow voters to register at the polls. California and other states should adopt this reform.

Democracies can work only when the losers accept the result. In recent years, only the most extreme voices have truly doubted Bush's claim to the Oval Office, and we can only hope that if Obama wins, only the most extreme voices on the right will truly doubt his election.

But our democracy needs more than hope. Well-meaning reforms have caused much of this mudslinging, and only sober, bipartisan efforts to change those laws will relegate charges of election fraud to the back pages of the newspapers.

Charles Stewart III is a professor of political science at MIT and co-director of the Caltech/MIT Voting Technology Project.