local: Make search filters more robust (fixes #635)