Adapted kdtree map to latest changes in rev's kdtree