Fixed compress & decompress in memory issues