Fixed error found during replacement of LaTex special characters