Fixes for compiling under windows