Fix combined AST building bug
A bit of DRY