small fix to discreterange code