Fix valid operation check.
Add tests for ReplayIterator methods.