Fixes for WIN32 compilation