v5.8.10 - code cleanup, untweak leaf detection a little bit