Finish reimplementing _ta_wrap(), some small issues might remain