duplicate: fix bug of NumInRange(), i_stop always < 0