Fixed session management and other stuff