Fixed issues with search not returning correct results