Fix windows bugs