bug fix in type transformation