Minor adjustments, refactor session start
Merge upstream changes