Counting: fixes #721