Fixed issue with custom gradients
Fixed another gradient issue