Correction to stopped thread handling, fixes #224