Fixed bug which would cause ranges to be inserted incorrectly

* Ranges which were past the end of the current ranges were being
inserted before current ranges.  This as been fixed.