Updates to multi-level inheritance support.

* Down-cast to final level even if we can't select the related data (in < 1.6)
* Fix bug where child classes are accepted if grand-child doesn't match even if
    there are more grand-child classes to check.