Bugfix in QSort and Order functions