Improve _avoid_format_types()
Change _avoid_format_types() to assertion