Be less strict to allow custom String class.