Gradient bug fixed