Fixed some bugs in interpolation