transformer test and bug fixing