Fixed a bug of type-function