fix invalid node types for references