Also testing multiple terminators.
Merge.
Fixed infinite loop in test.