Improve replacing test.