Index: libcfa/src/concurrency/thread.cfa
===================================================================
--- libcfa/src/concurrency/thread.cfa	(revision e35a32b2a7e933ee8d23dc606b6d66f5f775c938)
+++ libcfa/src/concurrency/thread.cfa	(revision fcd0b9d7282c8c187cc0111baf35ab6d4fb846a2)
@@ -83,11 +83,11 @@
 forall(dtype T | is_thread(T) | IS_EXCEPTION(ThreadCancelled, (T)))
 void ?{}( thread_dtor_guard_t & this,
-		T & thrd, void(*defaultResumptionHandler)(ThreadCancelled(T) &)) {
-	$monitor * m = get_monitor(thrd);
+		T & thrd, void(*cancelHandler)(ThreadCancelled(T) &)) {
+ 	$monitor * m = get_monitor(thrd);
 	$thread * desc = get_thread(thrd);
 
 	// Setup the monitor guard
 	void (*dtor)(T& mutex this) = ^?{};
-	bool join = defaultResumptionHandler != (void(*)(ThreadCancelled(T)&))0;
+	bool join = cancelHandler != (void(*)(ThreadCancelled(T)&))0;
 	(this.mg){&m, (void(*)())dtor, join};
 
@@ -103,7 +103,6 @@
 	}
 	desc->state = Cancelled;
-	if (!join) {
-		defaultResumptionHandler = default_thread_cancel_handler;
-	}
+	void(*defaultResumptionHandler)(ThreadCancelled(T) &) = 
+		join ? cancelHandler : default_thread_cancel_handler;
 
 	ThreadCancelled(T) except;
Index: src/ResolvExpr/PolyCost.cc
===================================================================
--- src/ResolvExpr/PolyCost.cc	(revision e35a32b2a7e933ee8d23dc606b6d66f5f775c938)
+++ src/ResolvExpr/PolyCost.cc	(revision fcd0b9d7282c8c187cc0111baf35ab6d4fb846a2)
@@ -35,5 +35,5 @@
 		PassVisitor<PolyCost> coster( env, indexer );
 		type->accept( coster );
-		return coster.pass.result;
+		return (coster.pass.result > 0) ? 1 : 0;
 	}
 
@@ -87,5 +87,5 @@
 	ast::Pass<PolyCost_new> costing( symtab, env );
 	type->accept( costing );
-	return costing.core.result;
+	return (costing.core.result > 0) ? 1 : 0;
 }
 
Index: tests/.expect/poly-selection.txt
===================================================================
--- tests/.expect/poly-selection.txt	(revision e35a32b2a7e933ee8d23dc606b6d66f5f775c938)
+++ tests/.expect/poly-selection.txt	(revision fcd0b9d7282c8c187cc0111baf35ab6d4fb846a2)
@@ -1,2 +1,5 @@
 friending generically
 friending specifically
+-
+f-generic
+f-specific
Index: tests/avltree/avl.h
===================================================================
--- tests/avltree/avl.h	(revision e35a32b2a7e933ee8d23dc606b6d66f5f775c938)
+++ tests/avltree/avl.h	(revision fcd0b9d7282c8c187cc0111baf35ab6d4fb846a2)
@@ -57,5 +57,5 @@
 void ?{}(tree(K, V) &t, K key, V value);
 
-forall(otype K, otype V)
+forall(otype K | Comparable(K), otype V)
 void ^?{}(tree(K, V) & t);
 
Index: tests/avltree/avl1.cfa
===================================================================
--- tests/avltree/avl1.cfa	(revision e35a32b2a7e933ee8d23dc606b6d66f5f775c938)
+++ tests/avltree/avl1.cfa	(revision fcd0b9d7282c8c187cc0111baf35ab6d4fb846a2)
@@ -13,5 +13,5 @@
 }
 
-forall(otype K, otype V)
+forall(otype K| Comparable(K), otype V)
 void ^?{}(tree(K, V) & t){
   delete(t.left);
Index: tests/poly-selection.cfa
===================================================================
--- tests/poly-selection.cfa	(revision e35a32b2a7e933ee8d23dc606b6d66f5f775c938)
+++ tests/poly-selection.cfa	(revision fcd0b9d7282c8c187cc0111baf35ab6d4fb846a2)
@@ -35,6 +35,28 @@
 }
 
+void testSpecializationFromGenericAccessibleWithExtraTyvars() {
+
+    forall( dtype T, dtype U )
+    struct map {};
+
+    forall( dtype T )
+    void f( T & ) {
+        printf("f-generic\n");
+    }
+
+    forall( dtype T )
+    void f( map(T, T) & ) {
+        printf("f-specific\n");
+    }
+
+    float one;
+    map(float, float) two;
+    f(one);
+    f(two);
+}
 
 int main() {
     testSpecializationFromGenericOverBareTyvar();
+    printf("-\n");
+    testSpecializationFromGenericAccessibleWithExtraTyvars();
 }
