   """
   @spec at(t, integer) :: grapheme | nil
 
-  def at(string, position) when is_integer(position) and position >= 0 do
+  def at(string, position) when is_binary(string) and is_integer(position) and position >= 0 do
     do_at(string, position)
   end
 
-  def at(string, position) when is_integer(position) and position < 0 do
+  def at(string, position) when is_binary(string) and is_integer(position) and position < 0 do
     position = length(string) + position
 
     case position >= 0 do


  """
  @spec last(t) :: grapheme | nil
  def last(string) do
    do_last(next_grapheme(string), nil)
  end


  def jaro_distance(_string, ""), do: 0.0
  def jaro_distance("", _string), do: 0.0

  def jaro_distance(string1, string2) when is_binary(string1) and is_binary(string2) do
    {chars1, len1} = chars_and_length(string1)
    {chars2, len2} = chars_and_length(string2)

