Fix Counting bug