Build and Compile Fix for Visual Studio 2010, 2012, and 14 CTP3

This is a cleaner version of #300 without the upstream merges.