minor changes to hmm lab

Improve compatibility with latex.
various cosmetic changes