Support windows with vc builder. Fix minor bugs.