Improved fixed code, fix bug in ClonePacket