Fixed SQL syntax error when search string includes a '
Fixed newlines