Added return type covariant instanceOf check.