Correct gradients according to new standards.
Merge master