Fix empty program
Fix terms in aggregate