Fixed bug with authentication and errors with certain search queries