Fixed legacy code with type_ argument for TypeFlag.
Added missing check for FromClass values in TypeFlag.type