Fix some bugs in LZ