Fix memory leak from action node rewrite