a few bug fixes in markov chain and MDP