Make project build on Visual Studio 2015

Also fixes some minor compiler warnings for a warning-free build.