Fixed test_kdtree.cpp (was using int instead of double), and

Also fixed a few compiler problems with MSVC2010.