Some session handling tweaks