Mingw fix

Could of small bits and pieces that stopped MinGW complaining.