Fix transformer's bugs