Fix sort_and_merge

Assignment is better than swap in this case