Fixed range merging -- it was messed up by buggy code in the sortfield merge.