Thread fixes