various search bug fixes