Fix count-leaves.