fixes for Visual C++ 2010 and 2012