Some Thread fixes