diff --git a/lib/modules/Sql.pmod/sql.pike b/lib/modules/Sql.pmod/sql.pike
index 72708a3f3fde9b314dd3af78a9a7742dc8f51e81..10d6d156e2fc071a84599c34773d61c3824c07a7 100644
--- a/lib/modules/Sql.pmod/sql.pike
+++ b/lib/modules/Sql.pmod/sql.pike
@@ -1,5 +1,5 @@
 /*
- * $Id: sql.pike,v 1.29 1999/06/01 20:41:00 marcus Exp $
+ * $Id: sql.pike,v 1.30 1999/06/14 22:14:42 grubba Exp $
  *
  * Implements the generic parts of the SQL-interface
  *
@@ -8,7 +8,7 @@
 
 //.
 //. File:	sql.pike
-//. RCSID:	$Id: sql.pike,v 1.29 1999/06/01 20:41:00 marcus Exp $
+//. RCSID:	$Id: sql.pike,v 1.30 1999/06/14 22:14:42 grubba Exp $
 //. Author:	Henrik Grubbstr�m (grubba@idonex.se)
 //.
 //. Synopsis:	Implements the generic parts of the SQL-interface.
@@ -179,9 +179,9 @@ void create(void|string|object host, void|string db,
       program_names = indices(Sql);
       // Restore compiler errors mode to whatever it was before.
       master()->inhibit_compile_errors = old_inhib;
+#endif /* PIKE_SQL_DEBUG */
 
       throw_errors = 0;
-#endif /* PIKE_SQL_DEBUG */
     }
 
     foreach(program_names, string program_name) {
@@ -220,8 +220,6 @@ void create(void|string|object host, void|string db,
 	      } else {
 		master_sql = p();
 	      }
-	      if(master_sql)
-		break;
 	    };
 	    if (err) {
 	      if (throw_errors) {
@@ -243,6 +241,8 @@ void create(void|string|object host, void|string db,
 #endif /* PIKE_SQL_DEBUG */
 	  }
 	};
+	if(master_sql)
+	  break;
 	if (err && throw_errors) {
 	  throw(err);
 	}