fixed some problems with program ast construction