Fixed issue with sessions prematurely closing.