Fixed some isinstance errors with opaque-keys
Removed some definition_key references
More isinstance fixes