Fixes a big bug with sessions.