Some fixes for windows