Fix gradients for clusters