Fixed creating segments in levels above leaves.