Threads now properly exit on disconnect