Made IndexKDTree to work.