Fixing bug of the calling of .next() twice for a hasNext()