Fix leaf-level position calculation. Calculate upper levels as well