<div dir="ltr">I believe the following code fixes the issue. Put this before \begin{document}:<br><br>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">\makeatletter</p>
<p style="margin: 0px; text-indent: 0px;">\long\def\parse@rsent#1#2\EInRTL#3#4#5\parse@end{\@sentdirfalse</p>
<p style="margin: 0px; text-indent: 0px;">\def\@tempa{\InRTL}\def\@tempb{\EInRTL}\def\@tempc{#1}\def\@tempd{#4}%</p>
<p style="margin: 0px; text-indent: 0px;">\ifx\@tempa\@tempc\ifx\@tempb\@tempd\@sentdirtrue\fi\fi}</p>
<p style="margin: 0px; text-indent: 0px;">\long\def\ifrsentence#1{\parse@rsent#1\EInRTL123\parse@end\if@sentdir}</p>
<p style="margin: 0px; text-indent: 0px;">\long\def\bidi@footnotetext@dir#1{%</p>
<p style="margin: 0px; text-indent: 0px;">   \@tempswatrue</p>
<p style="margin: 0px; text-indent: 0px;">   \ifrsentence{#1}\rtl\@tempswafalse\fi</p>
<p style="margin: 0px; text-indent: 0px;">   \iflsentence{#1}\ltr\@tempswafalse\fi</p>
<p style="margin: 0px; text-indent: 0px;">   \if@tempswa\if@RTL\rtl\else\ltr\fi\fi</p>
<p style="margin: 0px; text-indent: 0px;">   \xdef\bidi@this@footnote{\if@RTL\noexpand\right@footnote\else\noexpand\left@footnote\fi}%</p>
<p style="margin: 0px; text-indent: 0px;">}</p>
<p style="margin: 0px; text-indent: 0px;">\long\def\iflsentence#1{\parse@lsent#1\EInLTR123\parse@end\if@sentdir}</p>
<p style="margin: 0px; text-indent: 0px;">\long\def\parse@lsent#1#2\EInLTR#3#4#5\parse@end{\@sentdirfalse</p>
<p style="margin: 0px; text-indent: 0px;">\def\@tempa{\InLTR}\def\@tempb{\EInLTR}\def\@tempc{#1}\def\@tempd{#4}%</p>
<p style="margin: 0px; text-indent: 0px;">\ifx\@tempa\@tempc\ifx\@tempb\@tempd\@sentdirtrue\fi\fi}</p>
<p style="margin: 0px; text-indent: 0px;">\makeatother</p><p style="margin: 0px; text-indent: 0px;">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">
and you should have no problem. Thanks again for your bug report.<br></p><br clear="all"><br>-- <br>Vafa<br>
</div>