HPCC-9792 Swap stepped and sorted(..., assert)

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>