Fixed interpolation
Merging. Had the fix already in local branch.
Fixing weighted gradient because of new local/global stuff