Modified tests and optimize (Sequence|Repeated)Expression