Fix error when incrementing counters