It's unlikely anyone can know that without you providing a minimal complete self-contained example that shows the bug.
From the snippet you sent, I assume the primary problem is the use of char and eval. That is fragile and should not be necessary for symbolic computations in the first place.