some fixes to search with empty values