fixed counting bug again
Merge branch 'master' into benchmark