Added a few changes for MinGW