Check compatibility of types in change depending on whether it is a
term or a type.

Continuation of 1f05decaea97f1dc which was too restrictive.

This fixes the test-suite (and probably the contribs).