* fixing a bug where the null terminator was repeatedly written out by FormatWriter
 * fixing bugs in the viterbi calculation