some fixes
diff --git a/libasn1fix/asn1fix_param.c b/libasn1fix/asn1fix_param.c
index 6b3a629..f8e3a2e 100644
--- a/libasn1fix/asn1fix_param.c
+++ b/libasn1fix/asn1fix_param.c
@@ -50,8 +50,9 @@
 	rarg.lhs_params = expr->lhs_params;
 	rarg.rhs_pspecs = rhs_pspecs;
 	exc = asn1p_expr_clone_with_resolver(expr, resolve_expr, &rarg);
+	if(!exc) return NULL;
 	rpc = asn1p_expr_clone(rhs_pspecs, 0);
-	assert(exc && rpc);
+	assert(rpc);
 
 	/*
 	 * Create a new specialization.
@@ -137,6 +138,7 @@
 		expr->Identifier, expr->meta_type, expr->expr_type);
 	if(expr->meta_type == AMT_TYPE
 	|| expr->meta_type == AMT_VALUE
+	|| expr->meta_type == AMT_TYPEREF
 	|| expr->meta_type == AMT_VALUESET) {
 		DEBUG("Target is a simple type %s",
 			ASN_EXPR_TYPE2STR(expr->expr_type));