Fix polymorphic check.