pre-test post-rewrite repairs