Fixed bugs in new IR processing
Added types to internal IR and removed EMs