fixes to compile on Windows