Fixed #252

I ran the code in the example. @kilahm is right, the output is:
```
5
10

999
...
```