Don't rely on just one system
Where computers are used in critical situations, shouldn't it be standard practice to use at least three independent systems (different hardware and different software) to process all the data and then compare results?
A human count of the ballots could be one of the independent systems relied on. I appreciate that this means a delay while the count happens, but how important is speed? Once elected, governments tend to last for years so a delay of a few days isn't significant.
If the prospect of there being no politicians in government for a few days is intolerable then let the change from old to new take place after the election results are confirmed.