fix some Windoze related bugs