VS2013 fixes

Some fixes to VS2013