Fix interpolation function