Fixing array copying