Fix bugs in handling of unit types when expanding.

Also, use TermAction in TwoContext.etaExpandContext.