fixed a IndexOutOfBoundsException that occurred when decoding with half empty dictionary