Fixed counting problem.