Fixed sorting bug in SearchCommand when using spatial search.