The START command following a STOP command can cause misplaced counters. This commit fixes the bug by setting counter variables to their initial value as soon as STOP command reaches.