Fix bug with search when users are not logged in; found two more bugs.