I fix some problems in type function