compilation: fix bugs on windows