Fixed session bugs.