Fix use of sort function

With this fix, the sort parameter seems to finally work through the PB
interface.