Added some memory management code for decompression