bug fixes to initial MarkovState code