Fixed a bug with sessions.