Some KdTreeAccelerator fixes and simplifications.