Fixed generator to use ASTNodePtr's