Counting: fixes #725