fix bugs in gelman rubin diagnostic