     case remaining do
       [] ->
         {:{}, [], [tag | match]}
-      _  ->
+
+      _ ->
         keys = for {key, _} <- remaining, do: key
-        raise ArgumentError, "record #{inspect tag} does not have the key: #{inspect hd(keys)}"
+        raise ArgumentError, "record #{inspect(tag)} does not have the key: #{inspect(hd(keys))}"
     end
   end
 

          is_atom(unquote(kind)) and is_tuple(unquote(data)) and tuple_size(unquote(data)) > 0 and
            elem(unquote(data), 0) == unquote(kind)
        end
      false ->
        quote do
          result = unquote(data)
          kind = unquote(kind)
          is_atom(kind) and is_tuple(result) and tuple_size(result) > 0 and elem(result, 0) == kind
        end
    end
  end

  # Normalizes of record fields to have default values.
  @doc false
  def __fields__(type, fields) do
    normalizer_fun = fn
      {key, value} when is_atom(key) ->
        try do
          Macro.escape(value)
