added same fixes to VS2012