add remaining changes to restore Windows compatibility