ERIL: one-to-many bug fixed: tree-like structures

1. Error fixed for tree-like structures. (When src and dst tables are
the same).
2. Better error reporting for undeclared links.