Fixed threads persisting after exit