Fixed compilation errors with msvc 2012 compiler.