Bugfix

Lots of changes, detailed in each pull request
Not super keen on direct access to global state, but I don't have much context into how the UI is structured (would prefer some kind of view hierarchy where session information is attached via view initialization.