Some selection bugs fixed.
Merge pull request #883 from gorco/fixesSelection

Some selection bugs fixed.