fixed hangup in make_leaves