fix some localgradients