marked parametrized members

diff --git a/ChangeLog b/ChangeLog
index 3103354..4f61d4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,7 +3,7 @@
 
 	* Compiler now checks 64-bit overflows in constraints range handling
 	  code. No effect on the code produced by the compiler.
-	* Compiler support for tagged parametrized members.
+	* Compiler support for tagged and marked parametrized members.
 	* Empty tags to element map avoided.
 
 0.9.14:	2005-Apr-29
diff --git a/asn1c/enber.c b/asn1c/enber.c
index 4e38251..1ecef6f 100644
--- a/asn1c/enber.c
+++ b/asn1c/enber.c
@@ -377,9 +377,9 @@
 	  if(len != tlv_len) {
 		if(no_validation) fprintf(stderr, "Warning: ");
 		fprintf(stderr,
-			"%s: Could not encode value of %d chars "
-			"at line %d in %d bytes\n",
-			fname, len, lineno, tlv_len);
+			"%s: Could not encode value of %ld chars "
+			"at line %d in %ld bytes\n",
+			fname, (long)len, lineno, (long)tlv_len);
 		if(!no_validation) exit(EX_DATAERR);
 	  }
 	}
diff --git a/libasn1fix/asn1fix_param.c b/libasn1fix/asn1fix_param.c
index 8c9ce41..ba624cb 100644
--- a/libasn1fix/asn1fix_param.c
+++ b/libasn1fix/asn1fix_param.c
@@ -59,33 +59,53 @@
 }
 
 #define	SUBSTITUTE(to, from)	do {				\
-		asn1p_expr_t tmp, *__v;				\
-		if((to)->tag.tag_class				\
-		&& (from)->tag.tag_class) {			\
-			FATAL("Layered tagging "		\
-			"in parametrization "			\
-			"is not yet supported, "		\
-			"contact asn1c author for");		\
-			return -1;				\
+	asn1p_expr_t tmp, *__v;					\
+	if((to)->tag.tag_class					\
+	&& (from)->tag.tag_class) {				\
+		FATAL("Layered tagging in parametrization "	\
+		"is not yet supported, "			\
+		"contact asn1c author for assistance with");	\
+		return -1;					\
+	}							\
+	/* This code shall not be invoked too early */		\
+	assert((to)->combined_constraints == NULL);		\
+	assert((from)->combined_constraints == NULL);		\
+	/* Copy stuff, and merge some parameters */		\
+	tmp = *(to);						\
+	*(to) = *(from);					\
+	TQ_MOVE(&(to)->members, &(from)->members);		\
+	*(from) = tmp;						\
+	(to)->next = tmp.next;					\
+	(to)->parent_expr = tmp.parent_expr;			\
+	assert((to)->marker.flags == EM_NOMARK);		\
+	(to)->marker = tmp.marker;				\
+	if(tmp.tag.tag_class)					\
+		(to)->tag = tmp.tag;				\
+	if(tmp.constraints) {					\
+		if((to)->constraints) {				\
+			asn1p_constraint_t *ct;			\
+			ct = asn1p_constraint_new(		\
+				(to)->constraints->_lineno);	\
+			ct->type = ACT_CA_SET;			\
+			asn1p_constraint_insert(ct,		\
+				(to)->constraints);		\
+			asn1p_constraint_insert(ct,		\
+				tmp.constraints);		\
+			(to)->constraints = ct;			\
+		} else {					\
+			(to)->constraints = tmp.constraints;	\
 		}						\
-		tmp = *(to);					\
-		*(to) = *(from);				\
-		TQ_MOVE(&(to)->members, &(from)->members);	\
-		*(from) = tmp;					\
-		(to)->next = tmp.next;				\
-		(to)->parent_expr = tmp.parent_expr;		\
-		if(tmp.tag.tag_class)				\
-			(to)->tag = tmp.tag;			\
-		memset(&((from)->next), 0,			\
-			sizeof((from)->next));			\
-		memset(&((from)->members), 0,			\
-			sizeof((from)->members));		\
-		asn1p_expr_free(from);				\
-		TQ_FOR(__v, &((to)->members), next) {		\
-			assert(__v->parent_expr == (from));	\
-			__v->parent_expr = (to);		\
-		}						\
-	} while(0)
+	}							\
+	(from)->constraints = 0;				\
+	(from)->marker.default_value = 0;			\
+	memset(&((from)->next), 0, sizeof((from)->next));	\
+	memset(&((from)->members), 0, sizeof((from)->members));	\
+	asn1p_expr_free(from);					\
+	TQ_FOR(__v, &((to)->members), next) {			\
+		assert(__v->parent_expr == (from));		\
+		__v->parent_expr = (to);			\
+	}							\
+} while(0)
 
 static int
 asn1f_parametrize(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *ptype) {