Correctly replacing array.