         (do-access state side server)))))
 
 (defn end-run [state side]
-  (let [server (get-in @state [:run :server 0])]
+  (let [server (first (get-in @state [:run :server]))]
     (swap! state update-in [:runner :register :unsuccessful-run] #(conj % server))
     (swap! state assoc-in [:run :unsuccessful] true)
     (trigger-event state side :unsuccessful-run)

  (update! state side (apply assoc (cons card args))))

(defn resolve-prompt [state side {:keys [choice card] :as args}]
  (let [prompt (get-in @state [side :prompt 0])
        choice (if (= (:choices prompt) :credit)
                 (min choice (get-in @state [side :credit]))
                 choice)]

        (swap! state update-in [:corp :register :scored-agenda] #(+ (or % 0) (:agendapoints c)))
        (gain-agenda-point state :corp (:agendapoints c))
        (set-prop state :corp c :advance-counter 0)
        (when-let [current (first (get-in @state [:runner :current]))]
          (say state side {:user "__system__" :text (str (:title current) " is trashed.")})
          (trash state side current))
        (trigger-event state :corp :agenda-scored (assoc c :advance-counter 0))))))
