Bug with gradients fixed

Clean commit