The optimizer doesn't need to understand anything it's just an iterated mathematical construct. The author simply didn't bother to implement the necessary details to ensure numerical stability.
Alternatively it might be a problem with the scoring model in the end game.