Fix some rare but bad generation bugs.
Speedup large expansions.
Heuristically avoid using constant fields in infix expressions.