   read our [library guidelines](library-guidelines.html).
   """
   @spec get_env(app, key, value) :: value
-  def get_env(app, key, default \\ nil) do
+  def get_env(app, key, default \\ nil) when is_atom(app) do
     :application.get_env(app, key, default)
   end
 

  `fetch_env/2`. Returns `nil` if the application is not loaded.
  """
  @spec spec(app) :: [{key, value}] | nil
  def spec(app) do
    case :application.get_all_key(app) do
      {:ok, info} -> :lists.keydelete(:env, 1, info)
      :undefined -> nil

  stick after the application is loaded and also on application reload.
  """
  @spec put_env(app, key, value, timeout: timeout, persistent: boolean) :: :ok
  def put_env(app, key, value, opts \\ []) when is_atom(app) do
    :application.set_env(app, key, value, opts)
  end

