fix type checking for ANY and ALL
NOT type tests