Session manager in one struct + few fixes.