Fixed small bugs in tridigital encode and interrupted key encode.