Fix counter type detection