Fix encoder/decoder for huffman tables