Fix deprecation warnings (replace SortedDict by OrderedDict)