remove unnecessary capture
Adding tests for random terminators