fix(lean-util): handle case where incomplete hierarchical name ends with "."

Close #311
fix(lean-util): handle case where incomplete hierarchical name ends with "."