Fixed a bug of type equality test