Added rather .. heavy.. algorithm for both filtering entries, as well as ensuring that OSPF state is internally consistent (it won't contain dangling references, ever).