Fix missing if causing constant reset of counters.