Fixed some minor bugs regarding resampling