Support MinGW32, fix compiler warnings