What prevents the software from being altered during counting ?
Either hardware or software (or both) provisions preventing any such changes. With open source operating software AND hardware, promulgating any such action "should" be difficult in the extreme.