Counting: fixes #801 hopefully
fixes #829
Counting: fixes #635