[BUGFIX] Fixed endless loop if step is misused

If step is 0 or steps into the wrong direction a endless loop is created. This fixes it