Fix terminalFormulaNodes