Fixed some windows-specific code