Bug with gradients fixed

Clean commit
Merge pull request #4 from colasjojo/master

Bug with gradients fixed