Improvements to compile under windows