Code of function 'range.ds' amended