Fixed counter bug on reset