Fix errors in MSVC 2012