Reworked structure of static tests.
Relaxed semantics for casts of qualified types.