       case teardown(Map.get(state, port)) do
         :ok ->
           new_state = Map.delete(state, port)
-          {:reply, msg, new_state}
+          {:reply, :ok, new_state}
 
         {:error, error} ->
           {:reply, {:error, error}, state}
       end
     else
-      {:reply, {:error, :ebadf}, state} # @todo return different error atom
+      # @todo return different error atom
+      {:reply, {:error, :ebadf}, state}
     end
   end
 

          count: 0,
          direction: -1
        }
        {:ok, settings}

      {:error, error} ->

  end

  defp set_up(port, log_path, sample_rate) do
    with {:ok, settings} <- generate_settings(log_path, sample_rate),
         :ok <- UART.open(uart_pid(), port, @open_options),
         :ok <- UART.flush(uart_pid()),
         :ok <- UART.write(uart_pid(), @on),
