Fixed some bugs on SortedSet