Fixes in rule-based search