[fix] Clone array
[test] Adding tests