Be sure the gradient coefficients fit into short ints.