fix bugs in nfaConstructor stack and test it