Search fixes

- Fixed #2928
- Misc fixes

review: @devoncarew

I actually meant `static const String REACHED_MAX_RES...`, but ok.