Ported changes to Windows. Also updated makefiles