Fix erroneous thread toggling

Threads were being marked incorrectly, without clicking the button.
This fixes it.