fixed minor bug with mingw compile