Merge pull request #1604 from Kenneth-T-Moore/bench

check_gradient should only check gradients that are declared for a component
cleanup: