Update TerminateOnEnter to TerminateOnEOF