Fix leaf creation