Gradient further fix ups

Tested Gradient. (working)