Fix rewrite