fix index_range bug introduced in commit 82992a260badf922cd0177191a28d9d...

...38f85a34c