Replaced `cloneArray` with standard `slice` function;