compilation on win32 + some fixes