Fix transformer bugs