Fixed counter bug