bugfix: return nil if anchor not found on get_anchor xxxx function.
hotfix: trivial argument error.
hotfix: check to_node is record before find to_anchor.