fix check_gradients
update documentation with roxygen2 4.0.1