Fix a wrong comparison and saving a sorted set
Merge pull request #3 from Kroisse/master

Fix a wrong comparison and saving a sorted set