Replaced basicstring with six.string_types, added identification by content