Index: src/libcfa/concurrency/monitor.c
===================================================================
--- src/libcfa/concurrency/monitor.c	(revision 9c59cd48193768705e66136cbb6ac4371561090c)
+++ src/libcfa/concurrency/monitor.c	(revision ad1a8ddc10212d6dab0554fd2c2534b6d12a8173)
@@ -130,4 +130,9 @@
 	this_thread()->current_monitors      = this->prev_mntrs;
 	this_thread()->current_monitor_count = this->prev_count;
+}
+
+void debug_break() __attribute__(( noinline ))
+{
+	
 }
 
@@ -171,11 +176,18 @@
 
 	//Find the next thread(s) to run
-	unsigned short thread_count = count;
+	unsigned short thread_count = 0;
 	thread_desc * threads[ count ];
+	for(int i = 0; i < count; i++) {
+		threads[i] = 0;
+	}
+
+	debug_break();
 
 	for( int i = 0; i < count; i++) {
 		thread_desc * new_owner = next_thread( this->monitors[i] );
-		thread_count = insert_unique( threads, i, new_owner );
-	}
+		thread_count = insert_unique( threads, thread_count, new_owner );
+	}
+
+	debug_break();
 
 	LIB_DEBUG_PRINT_SAFE("Will unblock: ");
@@ -345,5 +357,7 @@
 
 static inline unsigned short insert_unique( thread_desc ** thrds, unsigned short end, thread_desc * val ) {
-	for(int i = 0; i < end; i++) {
+	if( !val ) return end;
+
+	for(int i = 0; i <= end; i++) {
 		if( thrds[i] == val ) return end;
 	}
