bug fixes for win32