It is not only compiling and running - when you optimize and test a system, it can run through many cycles, dependin on your test method. You must initialize global and static variables at every cycle start.
The right way to do it is
if(is(INITRUN)) zaehler = 0;