Fix for chain sampling bug