Fix bugs and optimized by OS Windows.