Fix in r_str_replace() function