Assortment of small fixes, hopefully fixing mingw and GCC 4.7 support #26 #27