Improve decompress memory allocation & add -len/-max params