Sorting fixes #8