Fix up -nonzero gradients.