Added stability improvements on windows