Fix copying of array contents