fixed some windows related bugs