Fixes to make it build properly on Windows