fix bugs with windows and VS.