The code for the KD tree seems to have an issue, as it only searches for leaf nodes without any fallback steps