viterbi path bug fix