Some changes to be able to test rewriting in the toploop