Fix exception during auto-sorting
Merge pull request #96 from schottra/master

Fix exception during auto-sorting