Minor fixes

Fixed conditions for search with different fields.