diff -urpN john-1.7.8-jumbo-7b/src/PHPS_fmt_plug.c john-1.7.8-jumbo-6b/src/PHPS_fmt_plug.c
--- john-1.7.8-jumbo-7b/src/PHPS_fmt_plug.c	2011-10-03 21:49:16.798750000 +0000
+++ john-1.7.8-jumbo-6b/src/PHPS_fmt_plug.c	2011-11-01 13:55:40.843750000 +0000
@@ -70,9 +70,15 @@ static void phps_init(struct fmt_main *p
 static char *Convert(char *Buf, char *ciphertext)
 {
 	unsigned long val, i;
-	char *cp = strchr(&ciphertext[7], '$');
+	char *cp;
+
+	if (text_in_dynamic_format_already(pFmt_Dynamic_6, ciphertext))
+		return ciphertext;
+
+	cp = strchr(&ciphertext[7], '$');
 	if (!cp)
 		return "*";
+
 	sprintf(Buf, "$dynamic_6$%s$", &cp[1]);
 	for (i = 0; i < 3; ++i)
 	{
@@ -87,14 +93,23 @@ static char *Convert(char *Buf, char *ci
 	return Buf;
 }
 
+static char *our_split(char *ciphertext, int index)
+{
+	return Convert(Conv_Buf, ciphertext);
+}
+
 static int phps_valid(char *ciphertext, struct fmt_main *pFmt)
 {
 	int i;
-	if (!ciphertext)
+	if (!ciphertext || strlen(ciphertext) < CIPHERTEXT_LENGTH)
 		return 0;
 
-	if (strlen(ciphertext) != CIPHERTEXT_LENGTH)
-		return 0;
+	if (!pFmt_Dynamic_6)
+		phps_init(pFmt);
+
+	if (strlen(ciphertext) != CIPHERTEXT_LENGTH) {
+		return pFmt_Dynamic_6->methods.valid(ciphertext, pFmt_Dynamic_6);
+	}
 
 	if (strncmp(ciphertext, "$PHPS$", 6) != 0)
 		return 0;
@@ -149,6 +164,7 @@ static void phps_init(struct fmt_main *p
 		pFmt_Dynamic_6 = dynamic_THIN_FORMAT_LINK(&fmt_PHPS, Convert(Conv_Buf, phps_tests[0].ciphertext), "phps");
 		fmt_PHPS.methods.salt   = our_salt;
 		fmt_PHPS.methods.binary = our_binary;
+		fmt_PHPS.methods.split = our_split;
 		fmt_PHPS.params.algorithm_name = pFmt_Dynamic_6->params.algorithm_name;
 		pFmt->private.initialized = 1;
 	}
diff -urpN john-1.7.8-jumbo-7b/src/dynamic.h john-1.7.8-jumbo-6b/src/dynamic.h
--- john-1.7.8-jumbo-7b/src/dynamic.h	2011-10-04 19:17:19.376875000 +0000
+++ john-1.7.8-jumbo-6b/src/dynamic.h	2011-11-01 18:38:39.031250000 +0000
@@ -106,6 +106,7 @@ void dynamic_DISPLAY_ALL_FORMATS();
 
 // Function used to 'link' a thin format into dynamic.  See PHPS_fmt.c for an example.
 struct fmt_main *dynamic_THIN_FORMAT_LINK(struct fmt_main *pFmt, char *ciphertext, char *orig_sig);
+int text_in_dynamic_format_already(struct fmt_main *pFmt, char *ciphertext);
 
 // We need access to this global to get functions and data which we 'link' to
 //extern struct fmt_main fmt_MD5gen;
diff -urpN john-1.7.8-jumbo-7b/src/dynamic_fmt.c john-1.7.8-jumbo-6b/src/dynamic_fmt.c
--- john-1.7.8-jumbo-7b/src/dynamic_fmt.c	2011-10-31 15:55:47.265625000 +0000
+++ john-1.7.8-jumbo-6b/src/dynamic_fmt.c	2011-11-01 15:51:13.562500000 +0000
@@ -684,7 +684,70 @@ static int valid(char *ciphertext, struc
 }
 
 static char *FixupIfNeeded(char *ciphertext, private_subformat_data *pPriv);
+static struct fmt_main *dynamic_Get_fmt_main(int which);
 static char *HandleCase(char *cp, int caseType);
+
+/*********************************************************************************
+ * init() here does nothing. NOTE many formats LINKING into us will have a valid
+ * that DOES do something, but ours does nothing.
+ *********************************************************************************/
+static void init(struct fmt_main *pFmt)
+{
+	private_subformat_data *pPriv = pFmt->private.data;
+	int i;
+
+	if (!pPriv || !strcmp(curdat.dynamic_WHICH_TYPE_SIG, pPriv->dynamic_WHICH_TYPE_SIG))
+		return;
+
+	dynamic_RESET(pFmt);
+	if (!pPriv)
+		return;
+
+	memcpy(&curdat, pPriv, sizeof(private_subformat_data));
+	dynamic_use_sse = curdat.dynamic_use_sse;
+	force_md5_ctx = curdat.force_md5_ctx;
+
+	fmt_MD5gen.params.max_keys_per_crypt = pFmt->params.max_keys_per_crypt;
+	fmt_MD5gen.params.min_keys_per_crypt = pFmt->params.min_keys_per_crypt;
+	fmt_MD5gen.params.format_name        = pFmt->params.format_name;
+	fmt_MD5gen.params.algorithm_name     = pFmt->params.algorithm_name;
+	fmt_MD5gen.params.benchmark_comment  = pFmt->params.benchmark_comment;
+	fmt_MD5gen.params.benchmark_length   = pFmt->params.benchmark_length;
+	if ( (pFmt->params.flags&FMT_UNICODE) && options.utf8 )
+		pFmt->params.plaintext_length = pPriv->pSetup->MaxInputLen * 3; // we allow for 3 bytes of utf8 data to make up the number of plaintext_length unicode chars.
+	else
+		fmt_MD5gen.params.plaintext_length   = pFmt->params.plaintext_length;
+	fmt_MD5gen.params.salt_size          = pFmt->params.salt_size;
+	if (pFmt->params.salt_size > 0)
+		++pFmt->params.salt_size;
+	fmt_MD5gen.params.flags              = pFmt->params.flags;
+
+	fmt_MD5gen.methods.cmp_all    = pFmt->methods.cmp_all;
+	fmt_MD5gen.methods.cmp_one    = pFmt->methods.cmp_one;
+	fmt_MD5gen.methods.cmp_exact  = pFmt->methods.cmp_exact;
+	fmt_MD5gen.methods.set_salt   = pFmt->methods.set_salt;
+	fmt_MD5gen.methods.salt       = pFmt->methods.salt;
+	fmt_MD5gen.methods.salt_hash  = pFmt->methods.salt_hash;
+	fmt_MD5gen.methods.split      = pFmt->methods.split;
+	fmt_MD5gen.methods.set_key    = pFmt->methods.set_key;
+	fmt_MD5gen.methods.get_key    = pFmt->methods.get_key;
+	fmt_MD5gen.methods.clear_keys = pFmt->methods.clear_keys;
+	fmt_MD5gen.methods.crypt_all  = pFmt->methods.crypt_all;
+	for (i = 0; i < 5; ++i)
+	{
+		fmt_MD5gen.methods.binary_hash[i] = pFmt->methods.binary_hash[i];
+		fmt_MD5gen.methods.get_hash[i]    = pFmt->methods.get_hash[i];
+	}
+
+#if !MD5_IMM
+	{
+		extern void MD5_std_init(struct fmt_main *pFmt);
+		MD5_std_init(pFmt);
+	}
+#endif
+}
+
+
 /*********************************************************************************
  * This function will add a $dynamic_#$ IF there is not one, and if we have a specific
  * format requested.  Also, it will add things like UserID, Domain, Fld3, Fld4,
@@ -694,14 +757,16 @@ static char *prepare(char *split_fields[
 {
 	char Tmp[80];
 	int i;
-	private_subformat_data *pPriv = pFmt->private.data;
+
 	char *cpBuilding=split_fields[1], *cpTmp=NULL;
 
-	if (!pPriv)
+	init(pFmt);
+
+	if (!pFmt->private.data)
 		return split_fields[1];
 
 	if (pFmt->params.salt_size && !strchr(split_fields[1], '$')) {
-		if (!pPriv->nUserName && !pPriv->FldMask)
+		if (!curdat.nUserName && !curdat.FldMask)
 			return split_fields[1];
 	}
 
@@ -720,24 +785,24 @@ static char *prepare(char *split_fields[
 		cpBuilding = ct;
 	}
 
-	cpBuilding = FixupIfNeeded(cpBuilding, pPriv);
+	cpBuilding = FixupIfNeeded(cpBuilding, &curdat);
 	if (strncmp(cpBuilding, "$dynamic_", 9))
 		return split_fields[1];
 
-	if (pPriv->nUserName && !strstr(cpBuilding, "$$U")) {
+	if (curdat.nUserName && !strstr(cpBuilding, "$$U")) {
 		char *userName=split_fields[0], *cp;
 		// assume field[0] is in format: username OR DOMAIN\\username  If we find a \\, then  use the username 'following' it.
 		cp = strchr(split_fields[0], '\\');
 		if (cp)
 			userName = &cp[1];
-		userName = HandleCase(userName, pPriv->nUserName);
+		userName = HandleCase(userName, curdat.nUserName);
 		cpTmp = mem_alloc_tiny(strlen(cpBuilding) + 1 + 3 + strlen(userName), MEM_ALIGN_NONE);
 		sprintf (cpTmp, "%s$$U%s", cpBuilding, userName);
 		cpBuilding = cpTmp;
 	}
 	for (i = 0; i <= 8; ++i) {
 		sprintf(Tmp, "$$F%d", i);
-		if ( split_fields[i] &&  (pPriv->FldMask&(MGF_FLDx_BIT<<i)) && !strstr(cpBuilding, Tmp)) {
+		if ( split_fields[i] &&  (curdat.FldMask&(MGF_FLDx_BIT<<i)) && !strstr(cpBuilding, Tmp)) {
 			cpTmp = mem_alloc_tiny(strlen(cpBuilding) + 1 + 4 + strlen(split_fields[i]), MEM_ALIGN_NONE);
 			sprintf (cpTmp, "%s$$F%d%s", cpBuilding, i, split_fields[i]);
 			cpBuilding = cpTmp;
@@ -746,61 +811,20 @@ static char *prepare(char *split_fields[
 	return cpBuilding;
 }
 
-/*********************************************************************************
- * init() here does nothing. NOTE many formats LINKING into us will have a valid
- * that DOES do something, but ours does nothing.
- *********************************************************************************/
-static void init(struct fmt_main *pFmt)
+static char *split(char *ciphertext, int index)
 {
-	private_subformat_data *pPriv = pFmt->private.data;
-	int i;
-
-	dynamic_RESET(pFmt);
-	if (!pPriv)
-		return;
-
-	memcpy(&curdat, pPriv, sizeof(private_subformat_data));
-	dynamic_use_sse = curdat.dynamic_use_sse;
-	force_md5_ctx = curdat.force_md5_ctx;
+	static char out[1024];
 
-	fmt_MD5gen.params.max_keys_per_crypt = pFmt->params.max_keys_per_crypt;
-	fmt_MD5gen.params.min_keys_per_crypt = pFmt->params.min_keys_per_crypt;
-	fmt_MD5gen.params.format_name        = pFmt->params.format_name;
-	fmt_MD5gen.params.algorithm_name     = pFmt->params.algorithm_name;
-	fmt_MD5gen.params.benchmark_comment  = pFmt->params.benchmark_comment;
-	fmt_MD5gen.params.benchmark_length   = pFmt->params.benchmark_length;
-	if ( (pFmt->params.flags&FMT_UNICODE) && options.utf8 )
-		pFmt->params.plaintext_length = pPriv->pSetup->MaxInputLen * 3; // we allow for 3 bytes of utf8 data to make up the number of plaintext_length unicode chars.
-	else
-		fmt_MD5gen.params.plaintext_length   = pFmt->params.plaintext_length;
-	fmt_MD5gen.params.salt_size          = pFmt->params.salt_size;
-	if (pFmt->params.salt_size > 0)
-		++pFmt->params.salt_size;
-	fmt_MD5gen.params.flags              = pFmt->params.flags;
+	if (!strncmp(ciphertext, "$dynamic", 8))
+		return ciphertext;
 
-	fmt_MD5gen.methods.cmp_all    = pFmt->methods.cmp_all;
-	fmt_MD5gen.methods.cmp_one    = pFmt->methods.cmp_one;
-	fmt_MD5gen.methods.cmp_exact  = pFmt->methods.cmp_exact;
-	fmt_MD5gen.methods.set_salt   = pFmt->methods.set_salt;
-	fmt_MD5gen.methods.salt       = pFmt->methods.salt;
-	fmt_MD5gen.methods.salt_hash  = pFmt->methods.salt_hash;
-	fmt_MD5gen.methods.split      = pFmt->methods.split;
-	fmt_MD5gen.methods.set_key    = pFmt->methods.set_key;
-	fmt_MD5gen.methods.get_key    = pFmt->methods.get_key;
-	fmt_MD5gen.methods.clear_keys = pFmt->methods.clear_keys;
-	fmt_MD5gen.methods.crypt_all  = pFmt->methods.crypt_all;
-	for (i = 0; i < 5; ++i)
-	{
-		fmt_MD5gen.methods.binary_hash[i] = pFmt->methods.binary_hash[i];
-		fmt_MD5gen.methods.get_hash[i]    = pFmt->methods.get_hash[i];
+	if (!strncmp(ciphertext, "md5_gen(", 8)) {
+		ciphertext += 8;
+		do ++ciphertext; while (*ciphertext != ')')	;		
 	}
+	sprintf(out, "%s%s", curdat.dynamic_WHICH_TYPE_SIG, ciphertext);
 
-#if !MD5_IMM
-	{
-		extern void MD5_std_init(struct fmt_main *pFmt);
-		MD5_std_init(pFmt);
-	}
-#endif
+	return out;
 }
 
 /*********************************************************************************
@@ -1395,6 +1419,34 @@ static void *salt(char *ciphertext)
 	int off, possible_neg_one=0;
 
 	memset(Salt, 0, SALT_SIZE+1);
+
+	// Ok, see if the wrong dynamic type is loaded (such as the 'last' dynamic type).
+	if (!strncmp(ciphertext, "$dynamic_", 9)) {
+		char *cp1 = ciphertext;
+		char *cp2 = curdat.dynamic_WHICH_TYPE_SIG;
+		while (*cp2 && *cp2 == *cp1) {
+			++cp1; ++cp2;
+		}
+		if (*cp2) {
+			char subformat[17];
+			struct fmt_main *pFmtLocal;
+			int nFmtNum;
+			memcpy(subformat, ciphertext, 16);
+			subformat[16] = 0;
+			cp2 = &subformat[9];
+			while (*cp2 && *cp2 != '$')
+				++cp2;
+			*cp2 = 0;
+			nFmtNum = -1;
+			sscanf(subformat, "$dynamic_%d", &nFmtNum);
+			if (nFmtNum==-1)
+				return Salt;
+			pFmtLocal = dynamic_Get_fmt_main(nFmtNum);
+			if (pFmtLocal)
+				init(pFmtLocal);
+		}
+	}
+
 	if (curdat.dynamic_FIXED_SALT_SIZE==0 && !curdat.nUserName && !curdat.FldMask)
 		return Salt;
 	if (!strncmp(ciphertext, "$dynamic_", 9))
@@ -1727,7 +1779,7 @@ struct fmt_main fmt_MD5gen =
 		init,
 		prepare,
 		valid,
-		fmt_default_split,
+		split,
 		binary,
 		salt,
 		{
@@ -4714,7 +4766,7 @@ void DynamicFunc__overwrite_from_last_ou
 		/* MD5_word *w; */
 #if MD5_X2
 		if (j&1)
-			{cpo = input_buf_X86[j>>MD5_X2].x2.B2; cpi = crypt_key_X86[j>>MD5_X2].x2.B2; /* w=input_buf_X86[j>>MD5_X2].x2.w2; */ }
+			{cpo = input_buf_X86[j>>MD5_X2].x2.B2; cpi = crypt_key_X86[j>>MD5_X2].x2.B2; /* w=input_buf_X86[j>>MD5_X2].x2.w2; */}
 		else
 #endif
 			{cpo = input_buf_X86[j>>MD5_X2].x1.B; cpi = crypt_key_X86[j>>MD5_X2].x1.B; /* w=input_buf_X86[j>>MD5_X2].x1.w; */ }
@@ -6815,6 +6867,7 @@ struct fmt_main *dynamic_THIN_FORMAT_LIN
 	pFmt->methods.get_key    = pFmtLocal->methods.get_key;
 	pFmt->methods.clear_keys = pFmtLocal->methods.clear_keys;
 	pFmt->methods.crypt_all  = pFmtLocal->methods.crypt_all;
+	pFmt->methods.prepare    = pFmtLocal->methods.prepare;
 	for (i = 0; i < 5; ++i)
 	{
 		pFmt->methods.binary_hash[i] = pFmtLocal->methods.binary_hash[i];
@@ -6823,6 +6876,10 @@ struct fmt_main *dynamic_THIN_FORMAT_LIN
 
 	init(pFmtLocal);
 
+	pFmt->private.data = mem_alloc_tiny(sizeof(private_subformat_data), MEM_ALIGN_WORD);
+	memcpy(pFmt->private.data, &curdat, sizeof(private_subformat_data));
+
+
 	return pFmtLocal;
 }
 
@@ -6840,6 +6897,18 @@ static char *FixupIfNeeded(char *ciphert
 	return ciphertext;
 }
 
+int text_in_dynamic_format_already(struct fmt_main *pFmt, char *ciphertext)
+{
+	private_subformat_data *pPriv;
+
+	if (!pFmt) return 0;
+	/* NOTE, it 'is' possible to get called here, without the private stuff being setup
+	  properly (in valid, etc).  So, we simply grab the static private stuff each time */
+	pPriv = pFmt->private.data;
+	if (!ciphertext || !pPriv || !pPriv->dynamic_WHICH_TYPE_SIG) return 0;
+	return !strncmp(ciphertext, pPriv->dynamic_WHICH_TYPE_SIG, strlen(pPriv->dynamic_WHICH_TYPE_SIG));
+}
+
 // if caseType == 1, return cp
 // if caseType == 2, return upcase(cp)
 // if caseType == 3, return locase(cp)
diff -urpN john-1.7.8-jumbo-7b/src/john.c john-1.7.8-jumbo-6b/src/john.c
--- john-1.7.8-jumbo-7b/src/john.c	2011-10-03 20:58:26.611250000 +0000
+++ john-1.7.8-jumbo-6b/src/john.c	2011-11-01 18:05:48.000000000 +0000
@@ -131,11 +131,11 @@ static void john_register_all(void)
 	john_register_one(&fmt_AFS);
 	john_register_one(&fmt_LM);
 
-#include "fmt_registers.h"
-
 	for (i = 0; i < cnt; ++i)
 		john_register_one(&(pFmts[i]));
 
+#include "fmt_registers.h"
+
 #if OPENSSL_VERSION_NUMBER >= 0x00908000
 	john_register_one(&fmt_rawSHA224);
 	john_register_one(&fmt_rawSHA256);
diff -urpN john-1.7.8-jumbo-7b/src/loader.c john-1.7.8-jumbo-6b/src/loader.c
--- john-1.7.8-jumbo-7b/src/loader.c	2011-10-07 14:39:18.517500000 +0000
+++ john-1.7.8-jumbo-6b/src/loader.c	2011-10-31 21:20:54.515625000 +0000
@@ -573,12 +573,15 @@ void ldr_load_pw_file(struct db_main *db
 static void ldr_load_pot_line(struct db_main *db, char *line)
 {
 	struct fmt_main *format = db->format;
-	char *ciphertext;
+	char *ciphertext, *unprepared;
 	void *binary;
 	int hash;
 	struct db_password *current;
+	char *flds[10] = {0};
 
-	ciphertext = ldr_get_field(&line, db->options->field_sep_char);
+	unprepared = ldr_get_field(&line, db->options->field_sep_char);
+	flds[1] = unprepared;
+	ciphertext = format->methods.prepare(flds, format);
 	if (format->methods.valid(ciphertext,format) != 1) return;
 
 	ciphertext = format->methods.split(ciphertext, 0);
diff -urpN john-1.7.8-jumbo-7b/src/mediawiki_fmt_plug.c john-1.7.8-jumbo-6b/src/mediawiki_fmt_plug.c
--- john-1.7.8-jumbo-7b/src/mediawiki_fmt_plug.c	2011-10-04 20:22:57.392500000 +0000
+++ john-1.7.8-jumbo-6b/src/mediawiki_fmt_plug.c	2011-11-01 13:55:40.906250000 +0000
@@ -84,6 +84,10 @@ static char *Convert(char *Buf, char *ci
 {
 	int i;
 	char *cp;
+
+	if (text_in_dynamic_format_already(pFmt_Dynamic_9, ciphertext))
+		return ciphertext;
+
 	cp = strchr(&ciphertext[3], '$');
 	if (!cp)
 		return "*";
@@ -97,16 +101,23 @@ static char *Convert(char *Buf, char *ci
 	return Buf;
 }
 
+static char *our_split(char *ciphertext, int index)
+{
+	return Convert(Conv_Buf, ciphertext);
+}
+
 static int mediawiki_valid(char *ciphertext, struct fmt_main *pFmt)
 {
 	int i;
 	char *cp;
 
-	if (!ciphertext)
-		return 0;
-
-	if (strncmp(ciphertext, "$B$", 3) != 0)
+	if (!ciphertext) 
 		return 0;
+	if (!pFmt_Dynamic_9)
+		mediawiki_init(pFmt);
+	if (strncmp(ciphertext, "$B$", 3) != 0) {
+		return pFmt_Dynamic_9->methods.valid(ciphertext, pFmt_Dynamic_9);
+	}
 
 	cp = strchr(&ciphertext[3], '$');
 	if (!cp)
@@ -117,8 +128,6 @@ static int mediawiki_valid(char *ciphert
 		if (atoi16[ARCH_INDEX(cp[i])] == 0x7F)
 			return 0;
 
-	if (!pFmt_Dynamic_9)
-		mediawiki_init(pFmt);
 	return pFmt_Dynamic_9->methods.valid(Convert(Conv_Buf, ciphertext), pFmt_Dynamic_9);
 }
 
@@ -156,6 +165,7 @@ static void mediawiki_init(struct fmt_ma
 		pFmt_Dynamic_9 = dynamic_THIN_FORMAT_LINK(&fmt_mediawiki, Convert(Conv_Buf, mediawiki_tests[0].ciphertext), "mediawiki");
 		fmt_mediawiki.methods.salt   = our_salt;
 		fmt_mediawiki.methods.binary = our_binary;
+		fmt_mediawiki.methods.split = our_split;
 		fmt_mediawiki.params.algorithm_name = pFmt_Dynamic_9->params.algorithm_name;
 		pFmt->private.initialized = 1;
 	}
diff -urpN john-1.7.8-jumbo-7b/src/phpassMD5_fmt_plug.c john-1.7.8-jumbo-6b/src/phpassMD5_fmt_plug.c
--- john-1.7.8-jumbo-7b/src/phpassMD5_fmt_plug.c	2011-10-04 20:23:41.626875000 +0000
+++ john-1.7.8-jumbo-6b/src/phpassMD5_fmt_plug.c	2011-11-01 18:45:48.843750000 +0000
@@ -75,17 +75,32 @@ static void phpassmd5_init(struct fmt_ma
 /* this function converts a 'native' phpass signature string into a $dynamic_17$ syntax string */
 static char *Convert(char *Buf, char *ciphertext)
 {
+	if (text_in_dynamic_format_already(pFmt_Dynamic_17, ciphertext))
+		return ciphertext;
+
 	sprintf(Buf, "$dynamic_17$%s%10.10s", &ciphertext[3+8+1], &ciphertext[2]);
 	return Buf;
 }
 
+static char *our_split(char *ciphertext, int index)
+{
+	return Convert(Conv_Buf, ciphertext);
+}
+
 static int phpassmd5_valid(char *ciphertext, struct fmt_main *pFmt)
 {
 		int i;
 		unsigned count_log2;
 
-		if (strlen(ciphertext) != 34)
+		if (!ciphertext || strlen(ciphertext) < CIPHERTEXT_LENGTH)
 				return 0;
+
+		if (!pFmt_Dynamic_17)
+			phpassmd5_init(pFmt);
+
+		if (strlen(ciphertext) != CIPHERTEXT_LENGTH) {
+			return pFmt_Dynamic_17->methods.valid(ciphertext, pFmt_Dynamic_17);
+		}
 		// Handle both the phpass signature, and the phpBB v3 signature (same formula)
 		// NOTE we are only dealing with the 'portable' encryption method
 		if (strncmp(ciphertext, "$P$", 3) != 0 && strncmp(ciphertext, "$H$", 3) != 0)
@@ -98,8 +113,6 @@ static int phpassmd5_valid(char *ciphert
 		if (count_log2 < 7 || count_log2 > 31)
 				return 0;
 
-		if (!pFmt_Dynamic_17)
-			phpassmd5_init(pFmt);
 		return pFmt_Dynamic_17->methods.valid(Convert(Conv_Buf, ciphertext), pFmt_Dynamic_17);
 }
 
@@ -135,6 +148,7 @@ static void phpassmd5_init(struct fmt_ma
 		pFmt_Dynamic_17 = dynamic_THIN_FORMAT_LINK(&fmt_phpassmd5, Convert(Conv_Buf, phpassmd5_tests[0].ciphertext), "phpass");
 		fmt_phpassmd5.methods.salt   = our_salt;
 		fmt_phpassmd5.methods.binary = our_binary;
+		fmt_phpassmd5.methods.split = our_split;
 		fmt_phpassmd5.params.algorithm_name = pFmt_Dynamic_17->params.algorithm_name;
 		pFmt->private.initialized = 1;
 	}
diff -urpN john-1.7.8-jumbo-7b/src/rawMD5go_fmt_plug.c john-1.7.8-jumbo-6b/src/rawMD5go_fmt_plug.c
--- john-1.7.8-jumbo-7b/src/rawMD5go_fmt_plug.c	2011-10-03 21:52:23.455000000 +0000
+++ john-1.7.8-jumbo-6b/src/rawMD5go_fmt_plug.c	2011-10-31 21:30:33.468750000 +0000
@@ -47,31 +47,36 @@ static struct fmt_tests rawmd5_tests[] =
 	{NULL}
 };
 
-static char Conv_Buf[80];
 static struct fmt_main *pFmt_Dynamic_0;
 static void rawmd5_init(struct fmt_main *pFmt);
+static char Conv_Buf[80];
 
-/* this function converts a 'native' raw md5 signature string into a $dynamic_0$ syntax string */
+/* this function converts a 'native' mediawiki signature string into a Dynamic_9 syntax string */
 static char *Convert(char *Buf, char *ciphertext)
 {
-	if (strlen(ciphertext)!=32)
-		return "*";
+	if (text_in_dynamic_format_already(pFmt_Dynamic_0, ciphertext))
+		return ciphertext;
 	sprintf(Buf, "$dynamic_0$%s", ciphertext);
 	return Buf;
 }
 
+
 static int valid(char *ciphertext, struct fmt_main *pFmt)
 {
 	int i;
 
-	if (strlen(ciphertext) != CIPHERTEXT_LENGTH) return 0;
+	if (!ciphertext || strlen(ciphertext) < CIPHERTEXT_LENGTH)
+		return 0;
+	if (!pFmt_Dynamic_0)
+		rawmd5_init(pFmt);
+	if (strlen(ciphertext) != CIPHERTEXT_LENGTH) {
+		return pFmt_Dynamic_0->methods.valid(ciphertext, pFmt_Dynamic_0);
+	}
 	for (i = 0; i < CIPHERTEXT_LENGTH; i++){
 		if (!(  (('0' <= ciphertext[i])&&(ciphertext[i] <= '9')) ||
 					(('a' <= ciphertext[i])&&(ciphertext[i] <= 'f'))  ))
 			return 0;
 	}
-	if (!pFmt_Dynamic_0)
-		rawmd5_init(pFmt);
 	return pFmt_Dynamic_0->methods.valid(Convert(Conv_Buf, ciphertext), pFmt_Dynamic_0);
 }
 
diff -urpN john-1.7.8-jumbo-7b/src/rawmd5u_fmt_plug.c john-1.7.8-jumbo-6b/src/rawmd5u_fmt_plug.c
--- john-1.7.8-jumbo-7b/src/rawmd5u_fmt_plug.c	2011-10-04 20:24:17.595625000 +0000
+++ john-1.7.8-jumbo-6b/src/rawmd5u_fmt_plug.c	2011-10-31 21:33:06.593750000 +0000
@@ -62,8 +62,11 @@ static void rawmd5u_init(struct fmt_main
 /* this function converts a 'native' raw md5 signature string into a $dynamic_29$ syntax string */
 static char *Convert(char *Buf, char *ciphertext)
 {
-	if (strlen(ciphertext)!=32)
+	if (text_in_dynamic_format_already(pFmt_Dynamic_29, ciphertext))
+		return ciphertext;
+	if (!ciphertext || strlen(ciphertext) < CIPHERTEXT_LENGTH)
 		return "*";
+
 	sprintf(Buf, "$dynamic_29$%s", ciphertext);
 	return Buf;
 }
@@ -72,14 +75,20 @@ static int valid(char *ciphertext, struc
 {
 	int i;
 
-	if (strlen(ciphertext) != CIPHERTEXT_LENGTH) return 0;
+	if (!ciphertext || strlen(ciphertext) < CIPHERTEXT_LENGTH)
+		return 0;
+
+	if (!pFmt_Dynamic_29)
+		rawmd5u_init(pFmt);
+	if (strlen(ciphertext) != CIPHERTEXT_LENGTH) {
+		return pFmt_Dynamic_29->methods.valid(ciphertext, pFmt_Dynamic_29);
+	}
+
 	for (i = 0; i < CIPHERTEXT_LENGTH; i++){
 		if (!(  (('0' <= ciphertext[i])&&(ciphertext[i] <= '9')) ||
 					(('a' <= ciphertext[i])&&(ciphertext[i] <= 'f'))  ))
 			return 0;
 	}
-	if (!pFmt_Dynamic_29)
-		rawmd5u_init(pFmt);
 	return pFmt_Dynamic_29->methods.valid(Convert(Conv_Buf, ciphertext), pFmt_Dynamic_29);
 }
 
