Fix code refactoring to compile on windows.