Handle the range(N) case properly