Correctly solve for eigenvalue gradient.