Merge "Improve gradients" into jb-mr1-dev