fix bugs in comparator and sort algorithm.
version up