cleaned up some issues with check gradients