Fix a few bugs in decompression