MinGW related fixes and improvements (refs #6)