Fix rare bug that breaks invariants in exp.