fix 'high impact outstanding' issues as found by coverity
Deleting a set member while you have an iterator pointing at that member is undefined.
The post-increment operator returns a copy of the iterator and then increments it.
Merge pull request #100 from ged-lab/coverity

Coverity inspired fixes