Fixed the GroupedSubjectIterator when dealing with an empty iterator

If one of the subject iterators is empty, the GroupedSubjectIterator needs
to move to the next iterator, otherwise the iteration will be incomplete.
Merge pull request #430 from stof/fix_group_subject_iterator

Fixed the GroupedSubjectIterator when dealing with an empty iterator