Fixing NullPointerException that happens when the position is at the end
and we call the method peek. The correct behavior is: If the position is
already at the end, StopIteration is raised.