Fixed a session inconsistency bug. This really needs to be rewritten to avoid these types of scenarios.