fix windows implementation. close #2 #6 #7

@akiladila This is for you. Sorry to have taken so long. Can you try these changes? Thanks!