Fixed deepclone function for extending empty array and object