Fixing weird latex bug (depth=2^31-1)