* Fixed incorrect ASTNode traversal, improved reference indexing