fixes to sampler