Fixes for compiling in Windows