Fixing bug 1169, sorting orders results in an empty list