Added replace/3 and contains/2