Some minor fixes for MinGW compiler