More VS2012 compat changes and small fixes