AST generation fixes (model)