Some fixes for Windows