Index: branches/stable/cgi-bin/main.cgi
===================================================================
--- branches/stable/cgi-bin/main.cgi	(revision 100)
+++ branches/stable/cgi-bin/main.cgi	(revision 101)
@@ -918,5 +918,5 @@
 	  $city = $webvar{pop};
 	  $failmsg = "No suitable free block found.<br>\nYou will have to route another".
-	    " superblock to $webvar{city}<br>\nfrom one of the master blocks in Sudbury or".
+	    " superblock to $webvar{pop}<br>\nfrom one of the master blocks in Sudbury or".
 	    " chose a smaller blocksize.";
 	}
@@ -1129,7 +1129,7 @@
 
 	  # Insert the new freeblocks entries
-	  $sth = $ip_dbh->prepare("insert into freeblocks values (?, ?, ?,'y')");
+	  $sth = $ip_dbh->prepare("insert into freeblocks values (?, ?, (select city from routed where cidr >> '$cidr'),'y')");
 	  foreach my $block (@newfreeblocks) {
- 	    $sth->execute("$block", $block->masklen, $webvar{city});
+ 	    $sth->execute("$block", $block->masklen);
 	  }
 	  # Insert the allocations entry
