Small fixes to allow compilation on windows 32 bit and Mac OS