Implicit trait object coercion fixes.

Fixes 2 annoying issues with implicit trait object coercion: #11481 & #11197.