Some work on Windows compatibility