Corrected captures so that all gradients are covered.