This should fix sorting, if applied on top of scott's last patch, so it may be fixable in that patch, don't have time to test that part though. Hope this is of some help.