ENH: Implemented gradient checking.