Fixed a bug with downcasting for method calls.
We now ensure that we go as high as we can in the hierarchy but ignore types that have non-public methods.