fix kd-tree index for MSVC