Neither side should be able to pull tricks. There should be controls that both sides are comfortable with that ensure the integrity of the machines, the software, the voting process, the beginning counts, the count tallys, the reporting, and the eligibility of the voters.
Clearly this is missing in many of our elections or “tricks” could not be performed by either side.
The solution is no release of preliminary counts to the media until the official results are tallied.