Fix bug in transform