Fix replace_file.