Windows stability fixes