   [tbox]
   (apply union #{}
 	 (map #(role-names-in-expression (definition-expression %))
-	      (tbox-definitions tbox))))
+	      (vals (tbox-definition-map tbox)))))
 
 (defn used-concept-names
   "Returns all used concept names in tbox."
   [tbox]
   (apply union #{}
 	 (map #(concept-names-in-expression (definition-expression %))
-	      (tbox-definitions tbox))))
+              (vals (tbox-definition-map tbox)))))
 
 ;;;
 

  [[tbox target]]
  (let [needed-targets (collect-targets tbox #{target} #{}),
	new-tbox       (make-tbox (tbox-language tbox)
                                  (select-keys (tbox-definition-map tbox) needed-targets))]
    [new-tbox target]))

(defn expand-ttp

    seen
    (let [target  (first targets),
	  seen    (conj seen target),
	  targets (difference (union targets
                                     (set (free-symbols-in-expression
                                           (definition-expression
                                             (find-definition tbox target)))))
			      seen)]
      (recur tbox targets seen))))

