Fixed MCMC code