Make proper array cloning