Fix unit tests compilation and some compilation errors following changes for Visual Studio 2008.