fixed some issues with win32 compilation
some more fixes