SharePoint: SPField.Type is Invalid for TaxonomyField

In SharePoint the value of SPField.Type is Invalid for TaxonomyField. I was looping though the fields of a List and checking the Type of the field. So, I had to make extra check using TypeAsString to identify the Taxonomy field. If the value of TypeAsString is either "TaxonomyFieldType" or "TaxonomyFieldTypeMulti", then it is a TaxonomyField.Follwoing is the code: