MinGW port: more compiler warnings and linking issues fixed