Bug fixes for windows.