small fix and improvement to parsing of search string

- fix quotes ignored if followed by a parenthesis
- if quote is never closed, pretend the quote is closed at the end of the string