Fix possible str.replace freeze when unpacking packer