compilation: fix bugs for windows