VS2010 compatibility & warning fixes.