Small fixes in expression rewriting