Bugfix for sorting data objects. Yeesh.
Fixes suggested by Patrick for bad searches