Many changes to Session, small changes to in other places