Adjust the test and fix the rewrite method.