Remove debug code and add session fix code to ThreadList