Updated sorting and sorting tests.
Fixed sorting test. Sorting tests pass.