Index: src/libcfa/bits/algorithms.h
===================================================================
--- src/libcfa/bits/algorithms.h	(revision 5434d04e7a44a2c15e11c83a6017cfd4517c36bf)
+++ src/libcfa/bits/algorithms.h	(revision e1e8408b22136702256cde37d937165f85a711fb)
@@ -112,6 +112,6 @@
 static inline void __libcfa_small_sortN( void* * arr, size_t dim );
 
-forall( otype T | {  int ?<?( T, T ); int ?>?( T, T ); } )
-static inline void __libcfa_small_sort( T * arr, size_t dim ) {
+forall( dtype T )
+static inline void __libcfa_small_sort( T* * arr, size_t dim ) {
 	switch( dim ) {
 		case 1 : return;
Index: src/libcfa/stdlib
===================================================================
--- src/libcfa/stdlib	(revision 5434d04e7a44a2c15e11c83a6017cfd4517c36bf)
+++ src/libcfa/stdlib	(revision e1e8408b22136702256cde37d937165f85a711fb)
@@ -215,13 +215,13 @@
 void rand48seed( long int s );
 char rand48( void );
-char rand48( char l, char u );
+char rand48( char lower_bound, char upper_bound );
 int rand48( void );
 unsigned int rand48( void );
-unsigned int rand48( unsigned int u );
-unsigned int rand48( unsigned int l, unsigned int u );
+unsigned int rand48( unsigned int upper_bound );
+unsigned int rand48( unsigned int lower_bound, unsigned int upper_bound );
 long int rand48( void );
 unsigned long int rand48( void );
-unsigned long int rand48( unsigned long int u );
-unsigned long int rand48( unsigned long int l, unsigned long int u );
+unsigned long int rand48( unsigned long int upper_bound );
+unsigned long int rand48( unsigned long int lower_bound, unsigned long int upper_bound );
 float rand48( void );
 double rand48( void );
Index: src/tests/sched-ext-barge.c
===================================================================
--- src/tests/sched-ext-barge.c	(revision 5434d04e7a44a2c15e11c83a6017cfd4517c36bf)
+++ src/tests/sched-ext-barge.c	(revision e1e8408b22136702256cde37d937165f85a711fb)
@@ -42,9 +42,9 @@
 void main( barger_t & this ) {
 	yield();
-	while( barge( global ) ) { yield(((unsigned)rand48()) % 10); }
+	while( barge( global ) ) { yield( rand48(10) ); }
 }
 
 bool do_call( global_t & mutex this ) {
-	yield(((unsigned)rand48()) % 10);
+	yield(rand48(10));
 	if( this.state != WAITFOR && !this.done && this.started ) {
 		serr | "Barging before caller detected" | endl;
@@ -57,5 +57,5 @@
 thread caller_t {};
 void main( caller_t & this ) {
-	while( do_call(global) ) { yield(((unsigned)rand48()) % 10); }
+	while( do_call(global) ) { yield(rand48(10)); }
 }
 
@@ -63,5 +63,5 @@
 	this.started = true;
 	for( int i = 0; i < N; i++) {
-		yield(((unsigned)rand48()) % 10);
+		yield(rand48(10));
 		this.state = WAITFOR;
 		waitfor(do_call, this) {
Index: src/tests/sched-ext-dtor.c
===================================================================
--- src/tests/sched-ext-dtor.c	(revision 5434d04e7a44a2c15e11c83a6017cfd4517c36bf)
+++ src/tests/sched-ext-dtor.c	(revision e1e8408b22136702256cde37d937165f85a711fb)
@@ -45,5 +45,5 @@
 
 void main( dummy_t & this ) {
-	yield(((unsigned)rand48()) % 10);
+	yield(rand48(10));
 	set_state( this, MAIN );
 	waitfor( ^?{}, this ) {
@@ -58,5 +58,5 @@
 	for( int i = 0; i < N; i++ ){
 		dummy_t dummy[4];
-		yield( ((unsigned)rand48()) % 100 );
+		yield( rand48(100) );
 	}
 	sout | "Stopping" | endl;
Index: src/tests/sched-ext-recurse.c
===================================================================
--- src/tests/sched-ext-recurse.c	(revision 5434d04e7a44a2c15e11c83a6017cfd4517c36bf)
+++ src/tests/sched-ext-recurse.c	(revision e1e8408b22136702256cde37d937165f85a711fb)
@@ -15,5 +15,5 @@
 static const unsigned long N = 5_000ul;
 
-static inline void rand_yield() { yield(((unsigned)rand48()) % 10); }
+static inline void rand_yield() { yield(rand48(10)); }
 
 enum state_t { FIRST, SECOND, THIRD, LAST, STOP };
@@ -23,5 +23,5 @@
 	for (i = 0; i < 4; i++)
 	{
-		int j = ((unsigned)rand48()) % 4;
+		int j = rand48(4);
 		enum state_t t = array[j];
 		array[j] = array[i];
Index: src/tests/sched-ext-when.c
===================================================================
--- src/tests/sched-ext-when.c	(revision 5434d04e7a44a2c15e11c83a6017cfd4517c36bf)
+++ src/tests/sched-ext-when.c	(revision e1e8408b22136702256cde37d937165f85a711fb)
@@ -15,5 +15,5 @@
 static const unsigned long N = 4_998ul;
 
-static inline void rand_yield() { yield(((unsigned)rand48()) % 10); }
+static inline void rand_yield() { yield(rand48(10)); }
 
 monitor global_t {
Index: src/tests/sched-ext.c
===================================================================
--- src/tests/sched-ext.c	(revision 5434d04e7a44a2c15e11c83a6017cfd4517c36bf)
+++ src/tests/sched-ext.c	(revision e1e8408b22136702256cde37d937165f85a711fb)
@@ -26,8 +26,4 @@
 volatile bool done;
 
-unsigned rand10() {
-	return (unsigned)rand48() % 10;
-}
-
 //----------------------------------------------------------------------------------------------------
 // Acceptor
@@ -36,5 +32,5 @@
 void do_wait( global_t * mutex a ) {
 	sout | "Waiting to accept" | endl;
-	yield( rand10() );
+	yield( rand48(10) );
 
 	sout | "Accepting" | endl;
Index: src/tests/sched-int-barge.c
===================================================================
--- src/tests/sched-int-barge.c	(revision 5434d04e7a44a2c15e11c83a6017cfd4517c36bf)
+++ src/tests/sched-int-barge.c	(revision e1e8408b22136702256cde37d937165f85a711fb)
@@ -64,7 +64,7 @@
 
 	if( action == 0 ) {
-		c.do_signal = max( ((unsigned)rand48()) % 10, 1);
-		c.do_wait1 = ((unsigned)rand48()) % (c.do_signal);
-		c.do_wait2 = ((unsigned)rand48()) % (c.do_signal);
+		c.do_signal = max( rand48(10), 1);
+		c.do_wait1 = rand48(c.do_signal);
+		c.do_wait2 = rand48(c.do_signal);
 
 		if(c.do_wait1 == c.do_wait2) sout | "Same" | endl;
Index: src/tests/sched-int-block.c
===================================================================
--- src/tests/sched-int-block.c	(revision 5434d04e7a44a2c15e11c83a6017cfd4517c36bf)
+++ src/tests/sched-int-block.c	(revision e1e8408b22136702256cde37d937165f85a711fb)
@@ -49,5 +49,5 @@
 	wait( &cond, (uintptr_t)this_thread );
 
-	yield( ((unsigned)rand48()) % 10 );
+	yield( rand48(10) );
 
 	if(a.last_thread != a.last_signaller || b.last_thread != b.last_signaller ) {
@@ -58,5 +58,5 @@
 	a.last_thread = b.last_thread = this_thread;
 
-	yield( ((unsigned)rand48()) % 10 );
+	yield( rand48(10) );
 }
 
@@ -70,5 +70,5 @@
 //------------------------------------------------------------------------------
 void signal_op( global_data_t & mutex a, global_data_t & mutex b ) {
-	yield( ((unsigned)rand48()) % 10 );
+	yield( rand48(10) );
 
 	[a.last_thread, b.last_thread, a.last_signaller, b.last_signaller] = this_thread;
@@ -83,5 +83,5 @@
 		}
 
-		yield( ((unsigned)rand48()) % 10 );
+		yield( rand48(10) );
 
 		if(a.last_thread != next || b.last_thread != next) {
Index: src/tests/sched-int-disjoint.c
===================================================================
--- src/tests/sched-int-disjoint.c	(revision 5434d04e7a44a2c15e11c83a6017cfd4517c36bf)
+++ src/tests/sched-int-disjoint.c	(revision e1e8408b22136702256cde37d937165f85a711fb)
@@ -88,5 +88,5 @@
 	signal( &cond, a, data );
 
-	yield( (unsigned)rand48() % 10 );
+	yield( rand48(10) );
 
 	//This is technically a mutual exclusion violation but the mutex monitor protects us
Index: src/tests/sched-int-wait.c
===================================================================
--- src/tests/sched-int-wait.c	(revision 5434d04e7a44a2c15e11c83a6017cfd4517c36bf)
+++ src/tests/sched-int-wait.c	(revision e1e8408b22136702256cde37d937165f85a711fb)
@@ -62,5 +62,5 @@
 
 	while( waiter_left != 0 ) {
-		unsigned action = (unsigned)rand48() % 4;
+		unsigned action = rand48(4);
 		switch( action ) {
 			case 0:
