diff --git a/preprocessor/ExprNode.cc b/preprocessor/ExprNode.cc
index 9acb5c18dc7a6246635d3bc676fc21c4de6a377f..3974cbbfcb2486397f8314eca8a4dc45d5e8c088 100644
--- a/preprocessor/ExprNode.cc
+++ b/preprocessor/ExprNode.cc
@@ -1642,7 +1642,9 @@ UnaryOpNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
           new_output_type = output_type;
           break;
         }
+      output << "(";
       arg->writeOutput(output, new_output_type, temporary_terms, tef_terms);
+      output << ")";
       return;
     case oSteadyStateParamDeriv:
       {