[BUG #8400] Modify range selection algorithm