Add generator T and some fixes