Added support for polymorphic Key objects.