Fix nearest neighbor search in copyVertexColors.