Fix to_partial_path implementation