Fixed a bug in LZW Encoding