Fixed hmm to work with cython