Fix bugs on TID equals method and some others.