Fixed little errors in sorting of market