Made sure replace was called on a String object.