Fixed bad pointers in rewrite rules