Add tests for substitute.