Add test for gradients