fixing rewrite_all to work in the hypotheses as well.