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

Close #311