Fixed C++ unit test and Windows builds