MinGW build fixes as noted in the main branch's issues section

These are the changes that were noted in the issues section. It now builds in MinGW.