Fix array copying