Fix in Viterbi algorithm