Fix problem with copy arrays