Fixed bugs on win