Added 'team_number()' to the list of functions that are evaluated as intrinsic. Also changed the type of TEAM_TYPE (in TypePattern) to be DerivedType rather than IntType.
Implementation now no longer needs the static function MissingDerivedType() hack.
This was a guess.