cleanup search module, fix grid sorting.