More principled method for handling resampling/avoiding infinities.