Fix bug for single element kdTree