Add helper sub NOT_ALL_DEFINED_TYPE
Add proper type checks on anyof/allof