Fixed bug #3: Bad sorting