Fixed a bunch of linker and compiler warnings on Windows