Fixed Windows bugs