Remove debug code and add session fix code to ThreadList
Merge branch 'sessionFixes' into testing