[Olena-patches] milena r1683: Add a replace routine