Fixing an error in doNext

On a very fast application doNext can be called too often and pass through, resulting in an exception when we try to access the null iterator at the front of the empty deque
Merge pull request #1 from joshuajnoble/master

Fixing an error in doNext