Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision c0bf94ec8b5f4f0f6a4ac9de014bc1d596f29233)
+++ src/ResolvExpr/Resolver.cc	(revision b9f383f02133e2fd12cbee9fc0753d823a608d5e)
@@ -492,4 +492,8 @@
 			}
 
+			if(clause.target.arguments.empty()) {
+				SemanticError( stmt->location, "Waitfor clause must have at least one mutex parameter");
+			}
+
 			// Find all alternatives for all arguments in canonical form
 			std::vector< AlternativeFinder > argAlternatives;
@@ -556,4 +560,6 @@
 							auto param_end = function->parameters.end();
 
+							int n_mutex_arg = 0;
+
 							// For every arguments of its set, check if it matches one of the parameter
 							// The order is important
@@ -564,15 +570,17 @@
 									// We ran out of parameters but still have arguments
 									// this function doesn't match
-									SemanticError( function, "candidate function not viable: too many mutex arguments\n" );
+									SemanticError( function, toString("candidate function not viable: too many mutex arguments, expected ", n_mutex_arg, "\n" ));
 								}
 
+								n_mutex_arg++;
+
 								// Check if the argument matches the parameter type in the current scope
-								if( ! unify( (*param)->get_type(), arg.expr->get_result(), resultEnv, resultNeed, resultHave, openVars, this->indexer ) ) {
+								if( ! unify( arg.expr->get_result(), (*param)->get_type(), resultEnv, resultNeed, resultHave, openVars, this->indexer ) ) {
 									// Type doesn't match
 									stringstream ss;
 									ss << "candidate function not viable: no known convertion from '";
+									(*param)->get_type()->print( ss );
+									ss << "' to '";
 									arg.expr->get_result()->print( ss );
-									ss << "' to '";
-									(*param)->get_type()->print( ss );
 									ss << "'\n";
 									SemanticError( function, ss.str() );
@@ -588,5 +596,5 @@
 								// We ran out of arguments but still have parameters left
 								// this function doesn't match
-								SemanticError( function, "candidate function not viable: too few mutex arguments\n" );
+								SemanticError( function, toString("candidate function not viable: too few mutex arguments, expected ", n_mutex_arg, "\n" ));
 							}
 
