Remove rewrite cruft.
Fix missing defs.