Minor bugfixes in session shutdown code work workspace file writing and timer setup.
reformated/indented afterstep proper