Modified the interpolation code to handle scalar values.