bugfix in viterbi