fix a bug in cycle detection, improve unresolvable entity handling, fix
a bug in the new directory filter code I had started hacking into place
(that inadvertently broke some results)