Fix session handling.