Prevent polymorphic inheritance from other packages, fixed #366.