Bug correction in path_replace