Swap nodes when sorting to provide expected descending ordering