fixed convert_type method.