Modify to get working when building with g++/MinGW