Added copyNestedArray and tests