diff --git a/libwccl/ops/match/applyoperator.cpp b/libwccl/ops/match/applyoperator.cpp
index a24ce2646a08c644d5c8ae614b8bc6bce27ee3b1..9a5a9878b185a8ea5a4e254539354779d8fc70c2 100644
--- a/libwccl/ops/match/applyoperator.cpp
+++ b/libwccl/ops/match/applyoperator.cpp
@@ -20,8 +20,10 @@ ApplyOperator::ApplyOperator(
 
 void ApplyOperator::execute(const ActionExecContext &context) const
 {
-	boost::shared_ptr<MatchVector> matches =
-		boost::dynamic_pointer_cast<MatchVector>(context.variables()->get_fast(_matches));
+	MatchVector* matches =
+		dynamic_cast<MatchVector*>(
+			&context.variables()->get_fast(_matches)->get_value());
+	BOOST_ASSERT(matches);
 	context.sentence_context().goto_start();
 	while(context.sentence_context().is_current_inside()) {
 		int orig_pos = context.sentence_context().get_position();