Fix for setting selected attribute.
Merge pull request #1003 from reciprocity/feature/iterator-selection-fix

Fix for setting selected attribute.