Counting: fixes #715
Counting: merge master