Fix OR handling of search parameters with an existing 'where' in parameters; Fix search handling for 'having'