Fixed replace method

search() and replace() now use their former "advanced" algorithms by
default.