add support for windows and fix other issues