Index: /pom.xml
===================================================================
--- /pom.xml	(revision 28)
+++ /pom.xml	(revision 29)
@@ -6,5 +6,5 @@
 	<artifactId>partiesserver</artifactId>
 	<packaging>war</packaging>
-	<version>1.5.9</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.6.0</version> <!-- must equal ${geniusweb.version} -->
 	<name>partiesserver Maven Webapp</name>
 	<url>http://maven.apache.org</url>
@@ -19,5 +19,5 @@
 		<!-- <tomcat.version>8.0.53</tomcat.version> -->
 		<tomcat.version>8.5.20</tomcat.version>
-		<geniusweb.version>1.5.9</geniusweb.version>
+		<geniusweb.version>1.6.0</geniusweb.version>
 	</properties>
 
@@ -73,138 +73,139 @@
 
 		<dependency>
+			<groupId>tudelft.utilities</groupId>
+			<artifactId>listener</artifactId>
+			<version>1.1.1</version>
+		</dependency>
+		<dependency>
+			<groupId>tudelft.utilities</groupId>
+			<artifactId>logging</artifactId>
+			<version>1.0.1</version>
+		</dependency>
+		<dependency>
+			<groupId>tudelft.utilities</groupId>
+			<artifactId>tree</artifactId>
+			<version>1.1.2</version>
+		</dependency>
+		<dependency>
+			<groupId>tudelft.utilities</groupId>
+			<artifactId>files</artifactId>
+			<version>1.1.2</version>
+		</dependency>
+		<dependency>
+			<groupId>tudelft.utilities</groupId>
+			<artifactId>repository</artifactId>
+			<version>1.1.2</version>
+		</dependency>
+		<dependency>
+			<groupId>tudelft.utilities</groupId>
+			<artifactId>immutablelist</artifactId>
+			<version>1.1.2</version>
+		</dependency>
+
+
+		<dependency>
+			<groupId>javax.websocket</groupId>
+			<artifactId>javax.websocket-api</artifactId>
+			<version>1.1</version>
+		</dependency>
+
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>javax.servlet-api</artifactId>
+			<version>3.1.0</version>
+		</dependency>
+
+		<!-- the core, which includes Streaming API, shared low-level abstractions 
+			(but NOT data-binding) -->
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-core</artifactId>
+			<version>${jackson-2-version}</version>
+		</dependency>
+
+		<!-- Just the annotations; use this dependency if you want to attach annotations 
+			to classes without connecting them to the code. -->
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-annotations</artifactId>
+			<version>${jackson-2-version}</version>
+		</dependency>
+
+		<!-- databinding; ObjectMapper, JsonNode and related classes are here -->
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>${jackson-2-version}</version>
+		</dependency>
+
+		<!-- smile (binary JSON). Other artifacts in this group do other formats. -->
+		<dependency>
+			<groupId>com.fasterxml.jackson.dataformat</groupId>
+			<artifactId>jackson-dataformat-smile</artifactId>
+			<version>${jackson-2-version}</version>
+		</dependency>
+		<!-- JAX-RS provider -->
+		<dependency>
+			<groupId>com.fasterxml.jackson.jaxrs</groupId>
+			<artifactId>jackson-jaxrs-json-provider</artifactId>
+			<version>${jackson-2-version}</version>
+		</dependency>
+		<!-- Support for JAX-B annotations as additional configuration -->
+		<dependency>
+			<groupId>com.fasterxml.jackson.module</groupId>
+			<artifactId>jackson-module-jaxb-annotations</artifactId>
+			<version>${jackson-2-version}</version>
+		</dependency>
+
+		<!-- embedded-tomcat for testing the server -->
+		<dependency>
+			<groupId>org.apache.tomcat.embed</groupId>
+			<artifactId>tomcat-embed-core</artifactId>
+			<version>${tomcat.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.tomcat.embed</groupId>
+			<artifactId>tomcat-embed-jasper</artifactId>
+			<version>${tomcat.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.tomcat</groupId>
+			<artifactId>tomcat-jasper</artifactId>
+			<version>${tomcat.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.tomcat</groupId>
+			<artifactId>tomcat-jasper-el</artifactId>
+			<version>${tomcat.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.tomcat</groupId>
+			<artifactId>tomcat-jsp-api</artifactId>
+			<version>${tomcat.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tomcat.embed</groupId>
+			<artifactId>tomcat-embed-core</artifactId>
+			<version>${tomcat.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.tomcat</groupId>
+			<artifactId>tomcat-websocket</artifactId>
+			<version>${tomcat.version}</version>
+			<scope>test</scope>
+		</dependency>
+
+
+		<dependency>
 			<groupId>geniusweb.exampleparties</groupId>
 			<artifactId>randomparty</artifactId>
 			<version>${geniusweb.version}</version>
-			<scope>test</scope>
-		</dependency>
-
-		<dependency>
-			<groupId>tudelft.utilities</groupId>
-			<artifactId>listener</artifactId>
-			<version>1.1.1</version>
-		</dependency>
-		<dependency>
-			<groupId>tudelft.utilities</groupId>
-			<artifactId>logging</artifactId>
-			<version>1.0.1</version>
-		</dependency>
-		<dependency>
-			<groupId>tudelft.utilities</groupId>
-			<artifactId>tree</artifactId>
-			<version>1.1.2</version>
-		</dependency>
-		<dependency>
-			<groupId>tudelft.utilities</groupId>
-			<artifactId>files</artifactId>
-			<version>1.1.2</version>
-		</dependency>
-		<dependency>
-			<groupId>tudelft.utilities</groupId>
-			<artifactId>repository</artifactId>
-			<version>1.1.2</version>
-		</dependency>
-		<dependency>
-			<groupId>tudelft.utilities</groupId>
-			<artifactId>immutablelist</artifactId>
-			<version>1.1.2</version>
-		</dependency>
-
-
-		<dependency>
-			<groupId>javax.websocket</groupId>
-			<artifactId>javax.websocket-api</artifactId>
-			<version>1.1</version>
-		</dependency>
-
-		<dependency>
-			<groupId>javax.servlet</groupId>
-			<artifactId>javax.servlet-api</artifactId>
-			<version>3.1.0</version>
-		</dependency>
-
-		<!-- the core, which includes Streaming API, shared low-level abstractions 
-			(but NOT data-binding) -->
-		<dependency>
-			<groupId>com.fasterxml.jackson.core</groupId>
-			<artifactId>jackson-core</artifactId>
-			<version>${jackson-2-version}</version>
-		</dependency>
-
-		<!-- Just the annotations; use this dependency if you want to attach annotations 
-			to classes without connecting them to the code. -->
-		<dependency>
-			<groupId>com.fasterxml.jackson.core</groupId>
-			<artifactId>jackson-annotations</artifactId>
-			<version>${jackson-2-version}</version>
-		</dependency>
-
-		<!-- databinding; ObjectMapper, JsonNode and related classes are here -->
-		<dependency>
-			<groupId>com.fasterxml.jackson.core</groupId>
-			<artifactId>jackson-databind</artifactId>
-			<version>${jackson-2-version}</version>
-		</dependency>
-
-		<!-- smile (binary JSON). Other artifacts in this group do other formats. -->
-		<dependency>
-			<groupId>com.fasterxml.jackson.dataformat</groupId>
-			<artifactId>jackson-dataformat-smile</artifactId>
-			<version>${jackson-2-version}</version>
-		</dependency>
-		<!-- JAX-RS provider -->
-		<dependency>
-			<groupId>com.fasterxml.jackson.jaxrs</groupId>
-			<artifactId>jackson-jaxrs-json-provider</artifactId>
-			<version>${jackson-2-version}</version>
-		</dependency>
-		<!-- Support for JAX-B annotations as additional configuration -->
-		<dependency>
-			<groupId>com.fasterxml.jackson.module</groupId>
-			<artifactId>jackson-module-jaxb-annotations</artifactId>
-			<version>${jackson-2-version}</version>
-		</dependency>
-
-		<!-- embedded-tomcat for testing the server -->
-		<dependency>
-			<groupId>org.apache.tomcat.embed</groupId>
-			<artifactId>tomcat-embed-core</artifactId>
-			<version>${tomcat.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.tomcat.embed</groupId>
-			<artifactId>tomcat-embed-jasper</artifactId>
-			<version>${tomcat.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.tomcat</groupId>
-			<artifactId>tomcat-jasper</artifactId>
-			<version>${tomcat.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.tomcat</groupId>
-			<artifactId>tomcat-jasper-el</artifactId>
-			<version>${tomcat.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.tomcat</groupId>
-			<artifactId>tomcat-jsp-api</artifactId>
-			<version>${tomcat.version}</version>
-			<scope>test</scope>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.tomcat.embed</groupId>
-			<artifactId>tomcat-embed-core</artifactId>
-			<version>${tomcat.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.tomcat</groupId>
-			<artifactId>tomcat-websocket</artifactId>
-			<version>${tomcat.version}</version>
 			<scope>test</scope>
 		</dependency>
Index: /src/main/java/geniusweb/partiesserver/RunningPartiesUpdater.java
===================================================================
--- /src/main/java/geniusweb/partiesserver/RunningPartiesUpdater.java	(revision 28)
+++ /src/main/java/geniusweb/partiesserver/RunningPartiesUpdater.java	(revision 29)
@@ -27,5 +27,5 @@
 	 * before really killing the parties.
 	 */
-	private static final long KILL_DELAY = 2000;
+	public static final long KILL_DELAY = 5000;
 
 	/**
Index: /src/main/java/geniusweb/partiesserver/repository/RunningParty.java
===================================================================
--- /src/main/java/geniusweb/partiesserver/repository/RunningParty.java	(revision 28)
+++ /src/main/java/geniusweb/partiesserver/repository/RunningParty.java	(revision 29)
@@ -119,6 +119,6 @@
 		Date now = new Date();
 		return new RunningParty(party,
-				new PartyId("party" + (nr++) + "_" + uniqueid), name, now,
-				new Date(now.getTime() + maxRunTimeMS), null);
+				new PartyId(squash1(name) + "_" + uniqueid + "_" + (nr++)),
+				name, now, new Date(now.getTime() + maxRunTimeMS), null);
 	}
 
@@ -265,8 +265,30 @@
 															// never be needed
 			}
-			uniqueid = uniqueid.replaceAll("\\.", "_");
+			uniqueid = squash(uniqueid);
 		}
 		return uniqueid;
 	}
 
+	/**
+	 * 
+	 * @param string
+	 * @return string with all non-word characters replaced with "_" so that the
+	 *         result is a "word" ( [a-zA-Z_0-9] ).
+	 */
+	protected static String squash(String string) {
+		return string.replaceAll("\\W", "_");
+	}
+
+	/**
+	 * @param string
+	 * @return as squash, but additionally if the name does not start with a
+	 *         letter we prefix the string with 'p'
+	 */
+	protected static String squash1(String string) {
+		String res = squash(string);
+		if (res.matches("[a-zA-Z]\\w*"))
+			return res;
+		return "p" + res;
+	}
+
 }
Index: /src/main/java/geniusweb/partiesserver/websocket/ActiveThreads.java
===================================================================
--- /src/main/java/geniusweb/partiesserver/websocket/ActiveThreads.java	(revision 28)
+++ /src/main/java/geniusweb/partiesserver/websocket/ActiveThreads.java	(revision 29)
@@ -58,8 +58,12 @@
 			}
 
-			log.log(Level.INFO,
-					"Killing thread with stack trace\n" + stacktrace);
 			/* the most powerful kill, deprecated but required here. */
-			thread.stop();
+			try {
+				thread.stop();
+				log.log(Level.INFO,
+						"Killed thread with stack trace\n" + stacktrace);
+			} catch (ThreadDeath e) {
+				System.out.println("Noticed thread already was stopped.");
+			}
 		}
 		threads.clear();
Index: /src/test/java/geniusweb/partiesserver/AvailablePartiesUpdaterTest.java
===================================================================
--- /src/test/java/geniusweb/partiesserver/AvailablePartiesUpdaterTest.java	(revision 28)
+++ /src/test/java/geniusweb/partiesserver/AvailablePartiesUpdaterTest.java	(revision 29)
@@ -31,5 +31,5 @@
 
 public class AvailablePartiesUpdaterTest {
-	private static final String RANDOMPARTY = "target/jars/randomparty-1.5.9.jar";
+	private static final String RANDOMPARTY = "target/jars/randomparty-1.6.0.jar";
 	private static final int TESTRATE = 200; // check file changes every 200ms
 	@SuppressWarnings("unchecked")
Index: /src/test/java/geniusweb/partiesserver/JavaClientTest.java
===================================================================
--- /src/test/java/geniusweb/partiesserver/JavaClientTest.java	(revision 28)
+++ /src/test/java/geniusweb/partiesserver/JavaClientTest.java	(revision 29)
@@ -39,5 +39,5 @@
  */
 public class JavaClientTest {
-	private static final String RANDOMPARTY = "http://localhost:8080/partiesserver/run/randomparty-1.5.9";
+	private static final String RANDOMPARTY = "http://localhost:8080/partiesserver/run/randomparty-1.6.0";
 	private EmbeddedTomcat tomcat = new EmbeddedTomcat();
 	private JavaClient client = new JavaClient();
Index: /src/test/java/geniusweb/partiesserver/RunningPartiesUpdaterTest.java
===================================================================
--- /src/test/java/geniusweb/partiesserver/RunningPartiesUpdaterTest.java	(revision 28)
+++ /src/test/java/geniusweb/partiesserver/RunningPartiesUpdaterTest.java	(revision 29)
@@ -13,5 +13,4 @@
 
 import geniusweb.actions.PartyId;
-import geniusweb.partiesserver.RunningPartiesUpdater;
 import geniusweb.partiesserver.repository.RunningPartiesRepo;
 import geniusweb.partiesserver.repository.RunningParty;
@@ -39,5 +38,6 @@
 		updater.update();
 		verify(repo, times(0)).remove(id);
-		Thread.sleep(400 + 2000); // there is 2000 extra kill wait time
+		// we also need to account for the kill delay
+		Thread.sleep(400 + RunningPartiesUpdater.KILL_DELAY);
 		updater.update();
 		verify(repo, times(1)).remove(id);
Index: /src/test/java/geniusweb/partiesserver/repository/RunningPartyTest.java
===================================================================
--- /src/test/java/geniusweb/partiesserver/repository/RunningPartyTest.java	(revision 28)
+++ /src/test/java/geniusweb/partiesserver/repository/RunningPartyTest.java	(revision 29)
@@ -117,4 +117,23 @@
 		assertEquals(info, argument.getValue());
 	}
+
+	@Test
+	public void testSquash() {
+		assertEquals("12__3", running1.squash("12&$3"));
+	}
+
+	@Test
+	public void testSquash1() {
+		assertEquals("p12__3", running1.squash1("12&$3"));
+		assertEquals("party_32_12", running1.squash1("party+32=12"));
+		assertEquals("party_32_12", running1.squash1("party 32 12"));
+	}
+
+	@Test
+	public void testWeirdNames() {
+		new RunningParty(party1, id1, "bla#@12- @1/3", now, end, null);
+		new RunningParty(party1, id1, "12-bla#@12- @1/3", now, end, null);
+	}
+
 }
 
Index: /src/test/java/geniusweb/partiesserver/websocket/GeneralPartyInfoTest.java
===================================================================
--- /src/test/java/geniusweb/partiesserver/websocket/GeneralPartyInfoTest.java	(revision 28)
+++ /src/test/java/geniusweb/partiesserver/websocket/GeneralPartyInfoTest.java	(revision 29)
@@ -37,11 +37,17 @@
 	private GeneralPartyInfo info3;
 	private GeneralPartyInfo info4;
-	private String text1 = "GeneralPartyInfo.*iri1,Capabilities.*Behaviours=.*SAOP.*description 1.*";
-	private String text2 = "GeneralPartyInfo.*iri2,Capabilities.*Behaviours=.*SAOP.*,description 1.*";
-	private String text3 = "GeneralPartyInfo.*iri1,Capabilities.*Behaviours=.*SEB.*,description 1.*";
-	private String text4 = "GeneralPartyInfo.*iri1,Capabilities.*Behaviours=.*SAOP.*,description 2.*";
+	private String text1 = "GeneralPartyInfo.*iri1,Capabilities.*Profile.*SAOP.*description 1.*";
+	private String text2 = "GeneralPartyInfo.*iri2,Capabilities.*Profile.*SAOP.*,description 1.*";
+	private String text3 = "GeneralPartyInfo.*iri1,Capabilities.*Profile.*SEB.*,description 1.*";
+	private String text4 = "GeneralPartyInfo.*iri1,Capabilities.*Profile.*SAOP.*,description 2.*";
 
 	private final ObjectMapper jackson = new ObjectMapper();
 	private String serialized = "{\"uri\":\"http://iri1\",\"capabilities\":{\"behaviours\":[\"SAOP\"],\"profiles\":[\"geniusweb.profile.Profile\"]},\"description\":\"description 1\"}";
+
+	@SuppressWarnings("rawtypes")
+	public void test() {
+		Object a = 1;
+		List l = (List) a;
+	}
 
 	@Before
@@ -91,3 +97,4 @@
 		assertEquals(serialized, string);
 	}
+
 }
