fixed counting_range from a range.
Merge branch 'hotfix/trac_8617_counting_range' into develop