Fix nil error when step is greater than 1