Got maxopt_gradients to work.