Fixes to markov chain