fix device bug and interpolation bugs