diff --git a/base/ltmiscen.dtx b/base/ltmiscen.dtx
index 40f283c..b2d35c0 100644
--- a/base/ltmiscen.dtx
+++ b/base/ltmiscen.dtx
@@ -263,9 +263,9 @@
%
% \begin{macro}{\@testdef}
% \begin{macrocode}
-\def\@testdef #1#2#3{%
+\def\@testdef #1#2#3{{%
\def\reserved@a{#3}\expandafter \ifx \csname #1@#2\endcsname
- \reserved@a \else \@tempswatrue \fi}
+ \reserved@a \else \aftergroup\@tempswatrue \fi}}
% \end{macrocode}
% \end{macro}
%