fixed _to_path_head escaping output