fixes infinite loop with ranges when called with uneven steps (ex: range(0, 3, 2))

Fixes the bug caused by my previous pull request.

When the amount of steps is not divisible by the step argument, the for loop would loop forever (`0 !== 3`, `2 !== 3`, `4 !== 3`, `6 !== 3`, etc.).

My bad!