Retain sort order if object is an instance of SortedMap

Retain the original sort order, if converting from a SortedMap instance