[tree] FIX level in MaterializedPath if 'path_starts_with_separator' or 'path_ends_with_separator' are set