Minor fixes in the API that make session remembering work better