It has now been two weeks since the midterm elections, and in some states, ballots are still being counted.

President Trump says that is evidence of something seriously amiss. He has trafficked in wild and unsubstantiated theories, claiming that some ballots showed up “out of nowhere” while others were forged or went missing. He even says he has witnessed people donning disguises to vote multiple times.

This is perhaps no surprise, coming from someone who preposterously attributes his loss of the popular vote in 2016 to millions of illegally cast ballots. Study after study has shown that vote fraud is exceedingly rare.

The fact is, it is not only normal but also a healthy thing that so many hotly contested races this year have gone into overtime. Expect more of it in the future.

Counting votes has become more complicated and time-consuming, in part because, over the past decade, fewer people show up on Election Day and vote by machine. In 2016, 2 out of every 5 ballots were cast in early voting, by absentee and by mail. That was more than double the rate in 2004.

Becoming a voter is also easier by and large, notwithstanding recent controversies over purging of the rolls in Georgia, Ohio and elsewhere.

In the most recent election, Michigan and Nevada joined 13 other states and the District in approving automatic registration, which means their citizens will become eligible to vote when they get or renew driver’s licenses or do other business with the state, unless they opt out.

All of which would argue for being patient with those who administer our elections. Ballots should be counted painstakingly, particularly at a time when emotions are running high and polarization is deep.

Still, there are some things that should be done, starting now, to make elections go more smoothly.

For one, the basic infrastructure is in desperate need of an upgrade — something that has not been undertaken on a massive scale since Congress passed the Help America Vote Act, two years after the deadlocked 2000 presidential election. That legislation authorized $3.65 billion, known among election officials as “hanging chad money,” to help states modernize their voting systems.

But now, those improvements themselves have become outdated. Security concerns — including the potential for hacking — have added to the urgency for state-of-the-art technology.

More than 40 states use voting machines that are no longer being manufactured, Wendy R. Weiser, director of the democracy program at New York University law school’s Brennan Center for Justice, told me. When they need replacement parts, officials sometimes have to go on eBay to find them.

This year, Palm Beach County’s results were delayed when its machines overheated, requiring a recount of 174,000 early-voting ballots in Florida’s third-most-populous county.

“We chronically underfund our elections in the United States, and we don’t realize the problem until we have a close election,” said Michael McDonald, a University of Florida voting expert.

“Personally, I believe our democracy is worth something. We need to find the resources for it,” added Vermont Secretary of State Jim Condos, president of the National Association of Secretaries of State.

Though states have individualized systems for voting, the federal government can set standards. It should move to do so more aggressively. Among the sensible requirements it should impose to bolster public confidence in elections: some form of paper ballots and post-election audits of results. This would serve as a check on fears and conspiracy theories; in one Economist-YouGov poll this year, for instance, two-thirds of Democrats said they believe Russia tampered with vote tallies to get Trump elected president.

More money is not the only answer to making our elections work better.

Same-day registration — a version of which is now the law in 17 states and the District — would avoid many problems and much of the confusion that currently takes place at the polls.

There should also be an expansive period of early voting, which would reduce both Election Day lines and the potential for problems when machines do not work right. Currently, early-voting periods vary widely depending on where you live, from as few as 11 days in some states to as many as 45 days in others.

But let’s start by tamping down the volume and putting a little more faith in a system whose transparency would be envied in much of the rest of the world.

What won’t fix the problems are unfounded accusations of vote fraud. We should be reassured when it takes a long time to determine the winner of a closely fought contest. It is a healthy sign that our republic is taking care to properly discern the will of its people.