fixes for mingw
fixes for MSC