Fixed AvianFlu/ncp#60, need more testings on windows.