Fix compiling on VS2012.
Fix style.
Merge pull request #955 from yangyanli/fix_compiling_vs2012

Fix compiling on VS2012.