     validate_app(app)
     validate_version(version)
 
-    path    = Mix.Project.compile_path
-    beams   = Path.wildcard('#{path}/*.beam')
+    path = Mix.Project.compile_path
+    mods = modules_from(Path.wildcard('#{path}/*.beam')) |> Enum.sort
 
     target  = Path.join(path, "#{app}.app")
-    sources = Mix.Project.config_files ++ beams
+    sources = Mix.Project.config_files
 
-    if opts[:force] || Mix.Utils.stale?(sources, [target]) do
+    if opts[:force] || Mix.Utils.stale?(sources, [target]) || modules_changed?(mods, target) do
       best_guess = [
         vsn: to_char_list(version),
-        modules: modules_from(beams),
+        modules: mods,
         applications: [:kernel, :stdlib, :elixir]
       ]
 
       properties = if function_exported?(project, :application, 0) do
-        Mix.Utils.config_merge(best_guess, project.application)
+        Keyword.merge(best_guess, project.application)
       else
         best_guess
       end

  end

  defp ensure_correct_properties(app, properties) do
    properties = Keyword.from_enum(properties)
    properties = Keyword.put properties, :description,
                             to_char_list(properties[:description] || app)
    properties = Keyword.put properties, :registered, (properties[:registered] || [])
    validate_properties(properties)
    properties
  end

  defp validate_properties(properties) do

      _ ->
        :ok
    end

    properties
  end

  defp invalid(message) do
