fix jiotests clone function which crashed when trying to clone undefined