Fixed counting error