       #=> error
 
   """
-  @spec puts(device, chardata | String.Chars.t) :: :ok
+  @spec puts(device, chardata | String.Chars.t()) :: :ok
   def puts(device \\ :stdio, item) do
-    :io.put_chars map_dev(device), [to_chardata(item), ?\n]
+    :io.put_chars(map_dev(device), [to_chardata(item), ?\n])
   end
 
   @doc """

  See `IO.getn/3` for a description of return values.

  """
  @spec getn(chardata | String.Chars.t, pos_integer) :: chardata | nodata
  @spec getn(device, chardata | String.Chars.t) :: chardata | nodata
  def getn(prompt, count \\ 1)

  def getn(prompt, count) when is_integer(count) and count > 0 do

    case read(device, line_or_codepoints) do
      :eof ->
        {:halt, device}

      {:error, reason} ->
        raise IO.StreamError, reason: reason

      data ->
        {[data], device}
    end
