Modify make_path_relative function