Fix build system on Windows
Update gitignore
Fix compiler errors reported by MSVC