enabled windows to use stack in both ts/nts mode, some more fixes