The problem is most likely not in the LEAF path finding, but in your implementation, can you show the code of how you implement it?