Fix compiler error on windows and additional test failure fixes.