Fix Resampling bug