fix bugs on Win7