Threading bugs changes