Fix bug in Huffman code