Index: uspace/app/bithenge/expression.c
===================================================================
--- uspace/app/bithenge/expression.c	(revision 6e34bd064f1f4400be75c04c79e90a5d097c2927)
+++ uspace/app/bithenge/expression.c	(revision 03cad479d24a0461f4252c77bd91c3e03ea2f1a3)
@@ -271,7 +271,4 @@
 	.prefix_length = param_wrapper_prefix_length,
 	.destroy = param_wrapper_destroy,
-	.num_params = 0, /* This transform should not be used inside another
-			    param_wrapper or explicitly in a script, so this
-			    number doesn't matter. */
 };
 
@@ -295,5 +292,5 @@
 
 	rc = bithenge_init_transform(param_wrapper_as_transform(self),
-	    &param_wrapper_ops);
+	    &param_wrapper_ops, 0);
 	if (rc != EOK)
 		goto error;
Index: uspace/app/bithenge/transform.c
===================================================================
--- uspace/app/bithenge/transform.c	(revision 6e34bd064f1f4400be75c04c79e90a5d097c2927)
+++ uspace/app/bithenge/transform.c	(revision 03cad479d24a0461f4252c77bd91c3e03ea2f1a3)
@@ -44,7 +44,11 @@
  * @param[out] self Transform to initialize.
  * @param[in] ops Operations provided by the transform.
+ * @param num_params The number of parameters required. If this is nonzero, the
+ * transform will get its own context with parameters, probably provided by a
+ * param_wrapper. If this is zero, the existing outer context will be used with
+ * whatever parameters it has.
  * @return EOK or an error code from errno.h. */
 int bithenge_init_transform(bithenge_transform_t *self,
-    const bithenge_transform_ops_t *ops)
+    const bithenge_transform_ops_t *ops, int num_params)
 {
 	assert(ops);
@@ -53,4 +57,5 @@
 	self->ops = ops;
 	self->refs = 1;
+	self->num_params = num_params;
 	return EOK;
 }
@@ -99,5 +104,5 @@
 /** The ASCII text transform. */
 bithenge_transform_t bithenge_ascii_transform = {
-	&ascii_ops, 1
+	&ascii_ops, 1, 0
 };
 
@@ -159,5 +164,5 @@
 	                                                                       \
 	bithenge_transform_t bithenge_##NAME##_transform = {                   \
-		&NAME##_ops, 1                                                 \
+		&NAME##_ops, 1, 0                                              \
 	}
 
@@ -222,5 +227,5 @@
 /** The zero-terminated data transform. */
 bithenge_transform_t bithenge_zero_terminated_transform = {
-	&zero_terminated_ops, 1
+	&zero_terminated_ops, 1, 0
 };
 
@@ -480,5 +485,5 @@
 	}
 	rc = bithenge_init_transform(struct_as_transform(self),
-	    &struct_transform_ops);
+	    &struct_transform_ops, 0);
 	if (rc != EOK)
 		goto error;
@@ -579,5 +584,5 @@
 	}
 	rc = bithenge_init_transform(compose_as_transform(self),
-	    &compose_transform_ops);
+	    &compose_transform_ops, 0);
 	if (rc != EOK)
 		goto error;
Index: uspace/app/bithenge/transform.h
===================================================================
--- uspace/app/bithenge/transform.h	(revision 6e34bd064f1f4400be75c04c79e90a5d097c2927)
+++ uspace/app/bithenge/transform.h	(revision 03cad479d24a0461f4252c77bd91c3e03ea2f1a3)
@@ -46,4 +46,5 @@
 	const struct bithenge_transform_ops *ops;
 	unsigned int refs;
+	int num_params;
 } bithenge_transform_t;
 
@@ -66,6 +67,4 @@
 	 * @param self The transform. */
 	void (*destroy)(bithenge_transform_t *self);
-	/** The number of parameters required. */
-	int num_params;
 } bithenge_transform_ops_t;
 
@@ -136,6 +135,6 @@
 }
 
-/** Get the number of parameters required by a transform. Takes ownership of
- * nothing.
+/** Get the number of parameters required by a transform. This number is used
+ * by the parser and param-wrapper. Takes ownership of nothing.
  * @param self The transform.
  * @return The number of parameters required. */
@@ -143,6 +142,5 @@
 {
 	assert(self);
-	assert(self->ops);
-	return self->ops->num_params;
+	return self->num_params;
 }
 
@@ -220,5 +218,5 @@
 
 int bithenge_init_transform(bithenge_transform_t *self,
-    const bithenge_transform_ops_t *ops);
+    const bithenge_transform_ops_t *ops, int num_params);
 int bithenge_new_struct(bithenge_transform_t **out,
     bithenge_named_transform_t *subtransforms);
