Fixed regex format error trying to detect query error
Fixed issue with search queries not URI escaped
Misc bugfixes