Fixed bug in sort that projected onto one attribute