Fix error in cheb_grad(...)

- Vectors with overlapping memory are fixed.