A fixed version of interpolate_data