Improved exit criteria. Cosmetic changes.
Fix for "Multiple variables with sets in a single state #24" issue