Search fixes

- Fixed #2928
- Misc fixes

review: @devoncarew

Named constant