Added cloneObject procedure.