Fixing grads in dirichlet