Upgrade to VS2013 and minor fix