Well the truth is, it's not the machines that are the problem, it's the people running them.
Voting irregularities are primarily caused by incompetence on the part of those responsible for running elections. It is also true that some people don't care about an honest election as much as they care about their candidate of choice 'winning'.
Democracy works because the participants believe the government to be answerable to them. Of course this belief can be undermined. Democracies can be destabilized if there are enough people who believe the government is beyond their influence. They may decide to use force and intimidation as their way to power. Incidentally civil disobedience is not destabilizing because it requires those involved to except responsibility for their actions.
Electronic voting has been proposed as a way to compensate for human incompetence or corruption. Thus maintaining our faith in the electoral process. In reality it is nothing more than a blind faith in technology. The belief that if your doing it with a computer than it must be better It's also a way for people to avoid responsibility for past mistakes, or maybe even to cover up deliberate tampering.
Fortunately there are many examples of voting districts able to conduct several recounts in a matter of days with insignificant variation in their results. It would be an elementary change for voting districts with problems to observe the best practices of more efficient ones and imitate them.
The best practice seems to be paper ballots with optical scanning machines. This combines a physically verifiable record of the election and an electronic tally. You can count the votes till the cows come home and the results are the same.
Verifiability is the foundation upon which our confidence in the electoral process is built. My candidate may not have won this time but maybe next election. If I raise some money, do some campaigning, then next election we'll win for sure. With our ideas we can't loose! Yes sir, democracy is a wonderful thing.