[tree] (v2.4.0) FIX level in MaterializedPath

This is fix for the 2.4.0 branch (#834)