    :graph (.getGraph opts)
    :language (.getLanguage opts)
    :namespace (.getNamespace opts)
-   :permissions (map #(hash-map (.getRole %) (.toString (.getCapability %))) (.getPermissions opts)) 
+   :permissions (map #(hash-map (.getRole %) (.toString (.getCapability %))) (.getPermissions opts))
    :quality (.getQuality opts)
    :repair-level ((clojure.set/map-invert repair-level) (.getRepairLevel opts))
    :resolve-buffer-size (.getResolveBufferSize opts)

    ;; TODO A macro might be useful to replace the chain of when-lets with use-once variable names
    (when-let [epit (:effective-point-in-time options)]
      (.setEffectivePointInTime request (BigInteger. (str epit))))
    
    (when-let [locale (:locale options)]
      (.setLocale request locale)) ;; TODO enforce Locale object?
    (when-let [mar (:max-auto-retry options)]

  overridden (in part or in whole) with the optional parameter
  `type-mapping`, which should contain a transformation function keyed
  by an XCC type string. See `types` above."
  [result-sequence & [type-mapping]]
  ;; TODO throw informative exception if type not found in types
  (let [result (map (fn [item] (((merge types
                                       (when (map? type-mapping)
