Fix sorting
Merge pull request #162 from cortiz/master

Fix sorting