Fixed sorting tests