fix a bug in type_parse