fix #1, #5, now it is working under win.