Fixed warnings and errors for Visual C++ 2010.