fixed windows build

fixed #41 and #39

merge please

Many Thanks
Martell