Fix crashing getSearches due to missing sessions.
Various fixes.