Fixes for compiling on Windows