Fixed a crash with the previously fixed sorting function.
Removed a debug printout.