Session expiration handling fixes
Test fixes