Fixed counting bug for good.