Work around for SciPy bug in KDTree