Bad sorting debugging