Added CombineLoss type and fixed data race